private void OnTimerTick(object sender, EventArgs e)
 {
     try
     {
         _timer.Stop();
         // instantiate document
         _doc = new Document(BoxName, BoxName, "", DateTime.Now, null);
         //
         if (uCtrlDimensionsBox.ValueX < 1.0e-03 || uCtrlDimensionsBox.ValueY < 1.0e-03 || uCtrlDimensionsBox.ValueZ < 1.0e-03)
         {
             return;
         }
         // recompute optimisation
         PackOptimizer packOptimizer = new PackOptimizer(
             SelectedBox, SelectedPallet,
             BuildParamSetPackOptim(),
             cbColor.Color
             );
         _analyses = packOptimizer.BuildAnalyses(BuildConstraintSet(), allowMultipleLayerOrientations: true);
         // refill solution grid
         FillGrid();
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }
Exemplo n.º 2
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
            ParamSetPackOptim caseOptimConstraintSet = new ParamSetPackOptim(
                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
                );

            PackOptimizer caseOptimizer = new PackOptimizer(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());
            }
        }
Exemplo n.º 3
0
        private void OnTimerTick(object sender, EventArgs e)
        {
            try
            {
                _timer.Stop();
                // recompute optimisation
                var packOptimizer = new PackOptimizer(
                    SelectedBox, SelectedPallet, BuildConstraintSet(),
                    BuildParamSetPackOptim()
                    );
                _analyses = packOptimizer.BuildAnalyses(false);

                // refill solution grid
                FillGrid();
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
            }
        }
Exemplo n.º 4
0
 private void onTimerTick(object sender, EventArgs e)
 {
     try
     {
         _timer.Stop();
         // instantiate document
         _doc = new Document(BoxName, BoxName, "", DateTime.Now, null);
         // recompute optimisation
         PackOptimizer packOptimizer = new PackOptimizer(
             SelectedBox, SelectedPallet,
             BuildParamSetPackOptim(),
             cbColor.Color
             );
         _analyses = packOptimizer.BuildAnalyses(BuildConstraintSet());
         // refill solution grid
         FillGrid();
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }