Exemple #1
0
 public Vector3D InnerOffset(CaseOptimConstraintSet constraintSet)
 {
     return(new Vector3D(
                0.5 * constraintSet.WallThickness * constraintSet.NoWalls[0]
                , 0.5 * constraintSet.WallThickness * constraintSet.NoWalls[1]
                , 0.5 * constraintSet.WallThickness * constraintSet.NoWalls[2]));
 }
 public CaseDefinitionViewer(CaseDefinition caseDefinition, BoxProperties boxProperties, CaseOptimConstraintSet caseConstraintSet)
 {
     _caseDefinition = caseDefinition;
     _boxProperties = boxProperties;
     _caseOptimConstraintSet = caseConstraintSet;
     _globalOrientation = new Orientation(HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Y_P);
 }
 public double Area(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);
     return (constraintSet.NoWalls[0] * outerDim.Y * outerDim.Z
         + constraintSet.NoWalls[1] * outerDim.X * outerDim.Z
         + constraintSet.NoWalls[2] * outerDim.X * outerDim.Y) * UnitsManager.FactorSquareLengthToArea;
 }
 public CaseOptimAnalysis(
     BProperties boxProperties
     , PalletProperties palletProperties
     , PalletConstraintSet palletConstraintSet
     , CaseOptimConstraintSet caseOptimConstraintSet)
     : base(boxProperties.ParentDocument)
 {
 }
Exemple #5
0
        public double Area(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
        {
            Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);

            return((constraintSet.NoWalls[0] * outerDim.Y * outerDim.Z
                    + constraintSet.NoWalls[1] * outerDim.X * outerDim.Z
                    + constraintSet.NoWalls[2] * outerDim.X * outerDim.Y) * UnitsManager.FactorSquareLengthToArea);
        }
Exemple #6
0
        /// <summary>
        /// Returns true
        /// </summary>
        /// <param name="optimizer"></param>
        /// <returns></returns>
        public bool IsValid(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
        {
            Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);

            return(outerDim.X <= constraintSet.CaseLimitMax.X && outerDim.Y <= constraintSet.CaseLimitMax.Y && outerDim.Z <= constraintSet.CaseLimitMax.Z &&
                   outerDim.X >= constraintSet.CaseLimitMin.X && outerDim.Y >= constraintSet.CaseLimitMin.Y && outerDim.Z >= constraintSet.CaseLimitMin.Z &&
                   ((_dim0 == 0 && _dim1 == 1) || !constraintSet.ForceVerticalcaseOrientation));
        }
Exemple #7
0
 public CaseOptimAnalysis(
     BProperties boxProperties
     , PalletProperties palletProperties
     , PalletConstraintSet palletConstraintSet
     , CaseOptimConstraintSet caseOptimConstraintSet)
     : base(boxProperties.ParentDocument)
 {
 }
Exemple #8
0
 /// <summary>
 ///  Outer dimensions
 /// </summary>
 /// <param name="optimizer">Parent optimizer class</param>
 /// <returns>Outer dimensions stored in Vector3D</returns>
 public Vector3D OuterDimensions(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return(new Vector3D(
                _arrangement._iLength * boxProperties.Dim(Dim0) + constraintSet.WallThickness * constraintSet.NoWalls[0]
                , _arrangement._iWidth * boxProperties.Dim(Dim1) + constraintSet.WallThickness * constraintSet.NoWalls[1]
                , _arrangement._iHeight * boxProperties.Dim(Dim2) + constraintSet.WallThickness * constraintSet.NoWalls[2]
                ));
 }
 public CaseOptimizer(
     BoxProperties boxProperties
     , PalletProperties palletProperties
     , PalletConstraintSet palletContraintSet
     , CaseOptimConstraintSet caseOptimConstraintSet)
 {
     _boxProperties = boxProperties;
     _palletProperties = palletProperties;
     _palletConstraintSet = palletContraintSet;
     _caseOptimConstraintSet = caseOptimConstraintSet;
 }
 /// <summary>
 /// Instantiate a new case from a box, a case definition and a case optimization constraintset
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="bProperties">Box properties</param>
 /// <param name="constraintSet">Case optimization constraint set</param>
 public CaseOfBoxesProperties(Document document
     , BoxProperties boxProperties
     , CaseDefinition caseDefinition
     , CaseOptimConstraintSet constraintSet)
     : base(document)
 {
     _boxProperties = boxProperties;
     _boxProperties.AddDependancie(this);
     _caseDefinition = caseDefinition;
     _constraintSet = constraintSet;
     OnAttributeModified(boxProperties);
 }
 /// <summary>
 /// Instantiate a new case from a box, a case definition and a case optimization constraintset
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="bProperties">Box properties</param>
 /// <param name="constraintSet">Case optimization constraint set</param>
 public CaseOfBoxesProperties(Document document
                              , BoxProperties boxProperties
                              , CaseDefinition caseDefinition
                              , CaseOptimConstraintSet constraintSet)
     : base(document)
 {
     _boxProperties = boxProperties;
     _boxProperties.AddDependancie(this);
     _caseDefinition = caseDefinition;
     _constraintSet  = constraintSet;
     OnAttributeModified(boxProperties);
 }
Exemple #12
0
        static void Main(string[] args)
        {
            // define box properties
            BoxProperties boxProperties = new BoxProperties(null, 120.0, 100.0, 70.0);
            // define pallet properties
            PalletProperties palletProperties = new PalletProperties(null, "Block", 1200, 1000, 150);
            // define pallet constraintSet
            CasePalletConstraintSet constraintSet = new CasePalletConstraintSet();
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, true);
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, true);
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, true);
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, true);
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, true);
            constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, true);

            constraintSet.SetAllowedPattern("Column");
            constraintSet.SetAllowedPattern("Diagonale");
            constraintSet.SetAllowedPattern("Interlocked");
            constraintSet.SetAllowedPattern("Trilock");
            constraintSet.SetAllowedPattern("Spirale");

            constraintSet.AllowAlignedLayers = true;
            constraintSet.AllowAlternateLayers = true;

            constraintSet.MaximumHeight = 2000;
            constraintSet.MaximumNumberOfItems = 2000;
            constraintSet.UseMaximumHeight = true;
            constraintSet.UseMaximumPalletWeight = false;
            constraintSet.UseMaximumWeightOnBox = false;
            Console.WriteLine("=== Constraint set ===");
            Console.WriteLine(constraintSet.ToString());

            // define case optim constraintSet
            CaseOptimConstraintSet caseOptimConstraintSet = new CaseOptimConstraintSet(
                new int[3]{2, 2, 4}
                , 4.0, 0.01
                , new Vector3D(30.0, 30.0, 70.0)
                , new Vector3D(500.0, 500.0, 500.0)
                , false
                );

            CaseOptimizer caseOptimizer = new CaseOptimizer(boxProperties, palletProperties, constraintSet, caseOptimConstraintSet);

            // get all valid case definitions
            foreach (CaseDefinition caseDefinition in caseOptimizer.CaseDefinitions(48))
                Console.WriteLine(caseDefinition.ToString() + caseDefinition.OuterDimensions(boxProperties, caseOptimConstraintSet));
            // build list of solutions
            List<CaseOptimSolution> caseOptimSolutions = caseOptimizer.CaseOptimSolutions(48);
            foreach (CaseOptimSolution caseOptimSolution in caseOptimSolutions)
                Console.WriteLine(caseOptimSolution.ToString());
        }
 public CaseOfBoxesProperties CreateNewCaseOfBoxes(
     string name, string description
     , BoxProperties boxProperties
     , CaseDefinition caseDefinition
     , CaseOptimConstraintSet constraintSet)
 {
     CaseOfBoxesProperties caseProperties = new CaseOfBoxesProperties(this, boxProperties, caseDefinition, constraintSet);
     caseProperties.Name = name;
     caseProperties.Description = description;
     // insert in list
     _typeList.Add(caseProperties);
     // notify listeners
     NotifyOnNewTypeCreated(caseProperties);
     Modify();
     return caseProperties;
 }
 private void LoadOptimConstraintSet(XmlElement eltConstraintSet, out CaseOptimConstraintSet constraintSet)
 {
     string sNoWalls = eltConstraintSet.Attributes["NumberOfWalls"].Value;
     int[] iNoWalls = ParseInt3(sNoWalls);
     double wallThickness = UnitsManager.ConvertLengthFrom(
         Convert.ToDouble(eltConstraintSet.Attributes["WallThickness"].Value, System.Globalization.CultureInfo.InvariantCulture)
         , _unitSystem);
     double wallSurfaceMass = UnitsManager.ConvertSurfaceMassFrom(
         Convert.ToDouble(eltConstraintSet.Attributes["WallSurfaceMass"].Value, System.Globalization.CultureInfo.InvariantCulture)
         , _unitSystem);
     constraintSet = new CaseOptimConstraintSet(iNoWalls, wallThickness, wallSurfaceMass, Vector3D.Zero, Vector3D.Zero, false);
 }
 private void SaveCaseOptimConstraintSet(CaseOptimConstraintSet caseOptimConstraintSet, XmlElement xmlBoxProperties, XmlDocument xmlDoc)
 {
     XmlElement xmlCaseOptimConstraintSet = xmlDoc.CreateElement("OptimConstraintSet");
     xmlBoxProperties.AppendChild(xmlCaseOptimConstraintSet);
     // wall thickness
     XmlAttribute xmlWallThickness = xmlDoc.CreateAttribute("WallThickness");
     xmlWallThickness.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", caseOptimConstraintSet.WallThickness);
     xmlCaseOptimConstraintSet.Attributes.Append(xmlWallThickness);
     // wall surface mass
     XmlAttribute xmlWallSurfaceMass = xmlDoc.CreateAttribute("WallSurfaceMass");
     xmlWallSurfaceMass.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", caseOptimConstraintSet.WallSurfaceMass);
     xmlCaseOptimConstraintSet.Attributes.Append(xmlWallSurfaceMass);
     // no walls
     XmlAttribute xmlNumberOfWalls = xmlDoc.CreateAttribute("NumberOfWalls");
     xmlNumberOfWalls.Value = string.Format("{0} {1} {2}"
         , caseOptimConstraintSet.NoWalls[0]
         , caseOptimConstraintSet.NoWalls[1]
         , caseOptimConstraintSet.NoWalls[2]);
     xmlCaseOptimConstraintSet.Attributes.Append(xmlNumberOfWalls);
 }
 public double TotalWeight(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return InnerWeight(boxProperties) + EmptyWeight(boxProperties, constraintSet);
 }
 public double EmptyWeight(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return Area(boxProperties, constraintSet) * constraintSet.WallSurfaceMass;
 }
 public double OuterVolume(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);
     return outerDim.X * outerDim.Y * outerDim.Z;
 }
Exemple #19
0
        public double OuterVolume(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
        {
            Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);

            return(outerDim.X * outerDim.Y * outerDim.Z);
        }
Exemple #20
0
 public double TotalWeight(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return(InnerWeight(boxProperties) + EmptyWeight(boxProperties, constraintSet));
 }
 /// <summary>
 /// Returns true 
 /// </summary>
 /// <param name="optimizer"></param>
 /// <returns></returns>
 public bool IsValid(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     Vector3D outerDim = OuterDimensions(boxProperties, constraintSet);
     return outerDim.X <= constraintSet.CaseLimitMax.X && outerDim.Y <= constraintSet.CaseLimitMax.Y && outerDim.Z <= constraintSet.CaseLimitMax.Z
         && outerDim.X >= constraintSet.CaseLimitMin.X && outerDim.Y >= constraintSet.CaseLimitMin.Y && outerDim.Z >= constraintSet.CaseLimitMin.Z
         && ((_dim0 == 0 && _dim1 == 1) || !constraintSet.ForceVerticalcaseOrientation);
 }
Exemple #22
0
 public double CaseEmptyWeight(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return(constraintSet.WallSurfaceMass * Area(boxProperties, constraintSet));
 }
 public Vector3D InnerOffset(CaseOptimConstraintSet constraintSet)
 {
     return new Vector3D(
         0.5 * constraintSet.WallThickness * constraintSet.NoWalls[0]
         , 0.5 * constraintSet.WallThickness * constraintSet.NoWalls[1]
         , 0.5 * constraintSet.WallThickness * constraintSet.NoWalls[2]);
 }
 /// <summary>
 ///  Outer dimensions
 /// </summary>
 /// <param name="optimizer">Parent optimizer class</param>
 /// <returns>Outer dimensions stored in Vector3D</returns>
 public Vector3D OuterDimensions(BoxProperties boxProperties, CaseOptimConstraintSet constraintSet)
 {
     return new Vector3D(
         _arrangement._iLength * boxProperties.Dim(Dim0) + constraintSet.WallThickness * constraintSet.NoWalls[0]
         , _arrangement._iWidth * boxProperties.Dim(Dim1) + constraintSet.WallThickness * constraintSet.NoWalls[1]
         , _arrangement._iHeight * boxProperties.Dim(Dim2) + constraintSet.WallThickness * constraintSet.NoWalls[2]
         );
 }