Example #1
0
        /// <summary>
        /// Build a list of all case definitions given a number of box
        /// </summary>
        /// <param name="iNumber">Number of items to fit in box</param>
        /// <returns></returns>
        private List <CaseDefinition> CaseDefinitions(int iNumber)
        {
            // TODO: better as IEnumerable<>?
            var caseDefinitionList = new List <CaseDefinition>();

            foreach (PackArrangement arr in BoxArrangements(iNumber))
            {
                for (int i = 0; i < 3; ++i)
                {
                    for (int j = 0; j < 3; ++j)
                    {
                        if (j == i)
                        {
                            continue;
                        }

                        var caseDefinition = new CaseDefinition(arr, i, j);
                        if (caseDefinition.IsValid(BoxProperties, ParamSetPackOpt))
                        {
                            caseDefinitionList.Add(caseDefinition);
                        }
                    }
                }
            }
            return(caseDefinitionList);
        }
Example #2
0
        /// <summary>
        /// Build a list of all case definitions given a number of box
        /// </summary>
        /// <param name="iNumber">Number of items to fit in box</param>
        /// <returns></returns>
        public List <CaseDefinition> CaseDefinitions(int iNumber)
        {
            List <CaseDefinition> caseDefinitionList = new List <CaseDefinition>();

            foreach (CaseOptimArrangement arr in BoxArrangements(iNumber))
            {
                for (int i = 0; i < 3; ++i)
                {
                    for (int j = 0; j < 3; ++j)
                    {
                        if (j == i)
                        {
                            continue;
                        }

                        CaseDefinition caseDefinition = new CaseDefinition(arr, i, j);
                        if (caseDefinition.IsValid(_boxProperties, _caseOptimConstraintSet))
                        {
                            caseDefinitionList.Add(caseDefinition);
                        }
                    }
                }
            }
            return(caseDefinitionList);
        }