Changeset 9563 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs
- Timestamp:
- 06/02/13 04:26:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Problem/RegularIdenticalBinPackingProblem.cs
r9495 r9563 56 56 get { return (ValueParameter<B>)Parameters["PackingBinMeasures"]; } 57 57 } 58 public OptionalValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter {59 get { return ( OptionalValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; }58 public ConstrainedValueParameter<IPackingSolutionDecoder> PackingSolutionDecoderParameter { 59 get { return (ConstrainedValueParameter<IPackingSolutionDecoder>)Parameters["PackingSolutionDecoder"]; } 60 60 } 61 61 #endregion … … 85 85 Parameters.Add(new ValueParameter<B>("PackingBinMeasures", "Packing-bin data defining the measures of the used bins.", new B())); 86 86 Parameters.Add(new ValueParameter<IPackingPlanEvaluator>("PackingPlanEvaluator", "The evaluator is used to determine the quality of a solution.", CreateDefaultEvaluator())); 87 Parameters.Add(new OptionalValueParameter<IPackingSolutionDecoder>("PackingSolutionDecoder", "The operator that decodes the representation and creates a packing plan."));87 Parameters.Add(new ConstrainedValueParameter<IPackingSolutionDecoder>("PackingSolutionDecoder", "The operator that decodes the representation and creates a packing plan.")); 88 88 this.Maximization.Value = true; 89 89 InitializeProblemInstance(); … … 232 232 233 233 #region Problem instance handling 234 public void Load(BPPData data) { 234 public virtual void Load(BPPData data) { 235 var realData = data as RealBPPData; 235 236 var binData = new B(); 236 237 binData.InitializeFromMeasures (data.BinMeasures); … … 241 242 item.InitializeFromMeasures(data.ItemMeasures[j]); 242 243 item.AddTargetBinMeasures(data.BinMeasures); 244 if (realData != null) { 245 item.Weight = realData.ItemWeights[j]; 246 item.Material = realData.ItemMaterials[j]; 247 } 243 248 itemData.Add(item); 244 249 }
Note: See TracChangeset
for help on using the changeset viewer.