示例#1
0
        public override void RecomputeSolution()
        {
            // get best layers
            List <ILayer2D>   bestLayers     = SolutionLayered.Solver.BuildLayers(Content, ContainerDimensions, Offset.Z, ConstraintSet, true);
            List <LayerEncap> bestLayerDescs = bestLayers.ConvertAll(l => new LayerEncap(l.LayerDescriptor));

            bool allFound = true;

            foreach (LayerEncap l in SolutionLay.LayerEncaps)
            {
                if (null == bestLayerDescs.Find(bld => bld.Equals(l)))
                {
                    allFound = false;
                    break;
                }
            }
            if (allFound)
            {
                SolutionLay.RebuildLayers();
            }
            else // recomputes whole new solution
            {
                Solution = new SolutionLayered(this, bestLayerDescs);
            }
        }
示例#2
0
 public LayerSummary(SolutionLayered sol, int indexLayer, bool symetryX, bool symetryY)
 {
     Sol        = sol;
     IndexLayer = indexLayer;
     SymetryX   = symetryX;
     SymetryY   = symetryY;
 }
示例#3
0
 public void AddSolution(List <KeyValuePair <LayerEncap, int> > listLayers)
 {
     Solution = new SolutionLayered(this, listLayers);
 }
示例#4
0
 public void AddSolution(List <KeyValuePair <LayerDesc, int> > listLayers)
 {
     Solution = new SolutionLayered(this,
                                    listLayers.ConvertAll(l => new KeyValuePair <LayerEncap, int>(new LayerEncap(l.Key), l.Value))
                                    );
 }
示例#5
0
 public void AddSolution(List <LayerEncap> layers)
 {
     Solution = new SolutionLayered(this, layers);
 }
示例#6
0
 public void AddSolution(List <LayerDesc> layerDescs)
 {
     Solution = new SolutionLayered(this, layerDescs.ConvertAll(l => new LayerEncap(l)));
 }
示例#7
0
 public void AddSolution(ILayer2D layer, bool alternateLayers = true)
 {
     Solution = new SolutionLayered(this, layer, alternateLayers);
 }
示例#8
0
 public void AddSolution(LayerDesc layerDesc, bool alternateLayers = true)
 {
     Solution = new SolutionLayered(this, layerDesc, alternateLayers);
 }
示例#9
0
 public void AddSolution(ILayer2D layer, bool mirrorLength = true, bool mirrorWidth = true)
 {
     Solution = new SolutionLayered(this, layer, mirrorLength, mirrorWidth);
 }
示例#10
0
 public void AddSolution(LayerDesc layerDesc, bool mirrorLength = true, bool mirrorWidth = true)
 {
     Solution = new SolutionLayered(this, layerDesc, mirrorLength, mirrorWidth);
 }