Changeset 16575 for addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators
- Timestamp:
- 01/28/19 18:24:59 (5 years ago)
- Location:
- addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/BioBoostOperator.cs
r13071 r16575 26 26 using HeuristicLab.Operators; 27 27 using HeuristicLab.Parameters; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 30 30 namespace HeuristicLab.BioBoost.Operators { 31 [StorableType("9413703D-B45E-42AF-B2AE-82E6414E3924")] 31 32 public abstract class BioBoostOperator : SingleSuccessorOperator { 32 33 33 34 #region Parameters 34 public ILookupParameter<BioBoostProblemData> ProblemDataParameter { 35 get { return (ILookupParameter<BioBoostProblemData>) Parameters["ProblemData"]; } 35 public ILookupParameter<BioBoostProblemData> ProblemDataParameter 36 { 37 get { return (ILookupParameter<BioBoostProblemData>)Parameters["ProblemData"]; } 36 38 } 37 39 #endregion 38 40 39 41 #region Parameter Values 40 public BioBoostProblemData ProblemData { 42 public BioBoostProblemData ProblemData 43 { 41 44 get { return ProblemDataParameter.ActualValue; } 42 45 } … … 45 48 #region Construction & Cloning 46 49 [StorableConstructor] 47 protected BioBoostOperator( bool isDeserializing) : base(isDeserializing) {}50 protected BioBoostOperator(StorableConstructorFlag _) : base(_) { } 48 51 49 52 protected BioBoostOperator(BioBoostOperator original, Cloner cloner) : base(original, cloner) { } … … 56 59 protected T GetFromProblemData<T>(string label) where T : class, IItem { 57 60 IParameter param; 58 if (LayerDescriptor.PotentialsFromProblemData.IsSuffixOf(label)) {61 if (LayerDescriptor.PotentialsFromProblemData.IsSuffixOf(label)) { 59 62 ProblemData.FeedstockPotentials.TryGetValue(label, out param); 60 63 } else { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Crossover/CompoundCrossover.cs
r13071 r16575 37 37 using SinglePointRealVectorCrossover = HeuristicLab.Encodings.RealVectorEncoding.SinglePointCrossover; 38 38 using SinglePointInteverVectorCrossover = HeuristicLab.Encodings.IntegerVectorEncoding.SinglePointCrossover; 39 using HEAL.Attic; 39 40 40 41 namespace HeuristicLab.BioBoost.Operators.Crossover { 41 [Storable Class]42 [StorableType("DA8F3E29-D4F2-47A9-87DC-051922A528F5")] 42 43 public class CompoundCrossover : SingleSuccessorOperator, ICrossover { 43 44 … … 65 66 #region Construction & Cloning 66 67 [StorableConstructor] 67 protected CompoundCrossover( bool isDeserializing) : base(isDeserializing) {}68 protected CompoundCrossover(StorableConstructorFlag _) : base(_) { } 68 69 protected CompoundCrossover(CompoundCrossover orig, Cloner cloner) : base(orig, cloner) { } 69 70 public CompoundCrossover() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Crossover/MultiCrossover.cs
r13071 r16575 28 28 using HeuristicLab.PluginInfrastructure; 29 29 using System; 30 using HEAL.Attic; 30 31 31 32 namespace HeuristicLab.BioBoost.Operators.Mutation { 32 [Storable Class]33 [StorableType("EB607FBE-6802-4915-A3D1-48848E329B5C")] 33 34 public class MultiCrossover : StochasticMultiBranch<ICrossover>, ICrossover, IStochasticOperator { 34 35 … … 43 44 #region Construction & Cloning 44 45 [StorableConstructor] 45 protected MultiCrossover( bool isDeserializing) : base(isDeserializing) {}46 protected MultiCrossover(StorableConstructorFlag _) : base(_) { } 46 47 protected MultiCrossover(MultiCrossover orig, Cloner cloner) : base(orig, cloner) {} 47 48 public MultiCrossover() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Crossover/PlantBasedCrossover.cs
r13071 r16575 42 42 using DiscreteIntegerVectorCrossover = HeuristicLab.Encodings.IntegerVectorEncoding.DiscreteCrossover; 43 43 using DiscreteRealVectorCrossover = HeuristicLab.Encodings.RealVectorEncoding.DiscreteCrossover; 44 using HEAL.Attic; 44 45 45 46 namespace HeuristicLab.BioBoost.Operators.Crossover { 46 [Storable Class]47 [StorableType("D9455201-49C6-4042-8021-CCFD5199B731")] 47 48 public class PlantBasedCrossover : SingleSuccessorOperator, ICrossover, IStochasticOperator { 48 49 … … 70 71 #region Construction & Cloning 71 72 [StorableConstructor] 72 protected PlantBasedCrossover( bool isDeserializing) : base(isDeserializing) { }73 protected PlantBasedCrossover(StorableConstructorFlag _) : base(_) { } 73 74 protected PlantBasedCrossover(PlantBasedCrossover orig, Cloner cloner) : base(orig, cloner) { } 74 75 -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/LimitedDistanceTransportTargetCreator.cs
r13071 r16575 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.Random; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators { 34 35 35 [Storable Class]36 [StorableType("252FBBAC-C378-4378-B85D-6EB65863F4DF")] 36 37 public class LimitedDistanceTransportTargetCreator : BioBoostOperator, IIntegerVectorCreator { 37 38 … … 59 60 #region Construction & Cloning 60 61 [StorableConstructor] 61 protected LimitedDistanceTransportTargetCreator( bool isDeserializing) : base(isDeserializing) { }62 protected LimitedDistanceTransportTargetCreator(StorableConstructorFlag _) : base(_) { } 62 63 63 64 protected LimitedDistanceTransportTargetCreator(LimitedDistanceTransportTargetCreator orig, Cloner cloner) : base(orig, cloner) {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Moves/MoveEvaluatorAdapter.cs
r13071 r16575 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HEAL.Attic; 31 32 32 33 namespace HeuristicLab.BioBoost.Operators.Moves { 33 34 34 [Storable Class]35 [StorableType("01143196-726F-43C7-8F22-BB42D047E113")] 35 36 public class MoveEvaluatorAdapter : SingleSuccessorOperator, ISingleObjectiveMoveEvaluator { 36 37 … … 44 45 45 46 [StorableConstructor] 46 public MoveEvaluatorAdapter( bool isDeserializing) : base(isDeserializing) {}47 public MoveEvaluatorAdapter(StorableConstructorFlag _) : base(_) { } 47 48 48 49 public MoveEvaluatorAdapter(MoveEvaluatorAdapter orig, Cloner cloner) : base(orig, cloner) { } -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Moves/MoveGeneratorAdapter.cs
r13071 r16575 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.PluginInfrastructure; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators.Moves { 34 35 35 [Storable Class]36 [StorableType("01CF5EC3-F344-4A73-9BCD-7CE329392552")] 36 37 public class MoveGeneratorAdapter : SingleSuccessorOperator, IMoveGenerator { 37 38 … … 44 45 #region construction & cloning 45 46 [StorableConstructor] 46 public MoveGeneratorAdapter( bool isDeserializing) : base(isDeserializing) { }47 public MoveGeneratorAdapter(StorableConstructorFlag _) : base(_) { } 47 48 48 49 public MoveGeneratorAdapter(MoveGeneratorAdapter orig, Cloner cloner) : base(orig, cloner) { } -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Moves/MoveMakerAdapter.cs
r13071 r16575 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.PluginInfrastructure; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators.Moves { 34 35 35 [Storable Class]36 [StorableType("DDE891FB-AA05-4C76-A3AC-AEF8C6A5A2E3")] 36 37 public class MoveMakerAdapter : SingleSuccessorOperator, IMoveMaker { 37 38 … … 41 42 #region construction & cloning 42 43 [StorableConstructor] 43 public MoveMakerAdapter( bool isDeserializing) : base(isDeserializing) { }44 public MoveMakerAdapter(StorableConstructorFlag _) : base(_) { } 44 45 45 46 public MoveMakerAdapter(MoveMakerAdapter orig, Cloner cloner) : base(orig, cloner) { } -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/BoundaryToggleRealVectorMutator.cs
r13071 r16575 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using System; 27 using HEAL.Attic; 27 28 28 29 namespace HeuristicLab.BioBoost.Operators.Mutation { 29 [Storable Class]30 [StorableType("CC8C60CC-E58C-4FD6-95CA-F310064221AD")] 30 31 public class BoundaryToggleRealVectorMutator : RealVectorManipulator { 31 32 32 33 #region Construction & Cloning 33 34 [StorableConstructor] 34 protected BoundaryToggleRealVectorMutator( bool isDeserializing) : base(isDeserializing) { }35 protected BoundaryToggleRealVectorMutator(StorableConstructorFlag _) : base(_) { } 35 36 protected BoundaryToggleRealVectorMutator(BoundaryToggleRealVectorMutator orig, Cloner cloner) : base(orig, cloner) { } 36 37 public BoundaryToggleRealVectorMutator() { } -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/CommonTargetIntegerVectorMutator.cs
r13071 r16575 30 30 using System; 31 31 using System.Linq; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators.Mutation { 34 [Storable Class]35 [StorableType("10FB317B-D3BE-47EC-9BED-C7B211927C27")] 35 36 public class CommonTargetIntegerVectorMutator : BoundedIntegerVectorManipulator { 36 37 … … 54 55 #region Construction & Cloning 55 56 [StorableConstructor] 56 protected CommonTargetIntegerVectorMutator( bool isDeserializing) : base(isDeserializing) {}57 protected CommonTargetIntegerVectorMutator(StorableConstructorFlag _) : base(_) { } 57 58 protected CommonTargetIntegerVectorMutator(CommonTargetIntegerVectorMutator orig, Cloner cloner) : base(orig, cloner) {} 58 59 public CommonTargetIntegerVectorMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/CommonTargetSwappingIntegerVectorMutator.cs
r13071 r16575 30 30 using System; 31 31 using System.Linq; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators.Mutation { 34 [Storable Class]35 [StorableType("1C259A07-A1BA-46F3-9EE8-DF5EC7EF2C51")] 35 36 public class CommonTargetSwappingIntegerVectorMutator : BoundedIntegerVectorManipulator { 36 37 … … 54 55 #region Construction & Cloning 55 56 [StorableConstructor] 56 protected CommonTargetSwappingIntegerVectorMutator( bool isDeserializing) : base(isDeserializing) {}57 protected CommonTargetSwappingIntegerVectorMutator(StorableConstructorFlag _) : base(_) { } 57 58 protected CommonTargetSwappingIntegerVectorMutator(CommonTargetSwappingIntegerVectorMutator orig, Cloner cloner) : base(orig, cloner) {} 58 59 public CommonTargetSwappingIntegerVectorMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/CompoundMutator.cs
r13071 r16575 38 38 using UniformOnePositionManipulator = HeuristicLab.Encodings.IntegerVectorEncoding.UniformOnePositionManipulator; 39 39 using UniformOnePositionRealVectorManipulator = HeuristicLab.Encodings.RealVectorEncoding.UniformOnePositionManipulator; 40 using HEAL.Attic; 40 41 41 42 namespace HeuristicLab.BioBoost.Operators.Mutation { 42 [Storable Class]43 [StorableType("7B7699B9-4D4E-4D27-9DB5-F6F1FC5CBF52")] 43 44 public class CompoundMutator : SingleSuccessorOperator, IManipulator, IStochasticOperator { 44 45 … … 69 70 #region Construction & Cloning 70 71 [StorableConstructor] 71 protected CompoundMutator( bool isDeserializing) : base(isDeserializing) {}72 protected CompoundMutator(StorableConstructorFlag _) : base(_) { } 72 73 protected CompoundMutator(CompoundMutator orig, Cloner cloner) : base(orig, cloner) { } 73 74 public CompoundMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/DistanceBasedIntegerVectorMutator.cs
r13071 r16575 29 29 using System; 30 30 using System.Linq; 31 using HEAL.Attic; 31 32 32 33 namespace HeuristicLab.BioBoost.Operators.Mutation { 33 [Storable Class]34 [StorableType("37633B84-8BEF-410F-891B-953AD45342AE")] 34 35 public class DistanceBasedIntegerVectorMutator : IntegerVectorManipulator { 35 36 … … 64 65 #region Construction & Cloning 65 66 [StorableConstructor] 66 protected DistanceBasedIntegerVectorMutator( bool isDeserializing) : base(isDeserializing) {}67 protected DistanceBasedIntegerVectorMutator(StorableConstructorFlag _) : base(_) { } 67 68 protected DistanceBasedIntegerVectorMutator(DistanceBasedIntegerVectorMutator orig, Cloner cloner) : base(orig, cloner) {} 68 69 public DistanceBasedIntegerVectorMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/EmptyMutator.cs
r13071 r16575 24 24 using HeuristicLab.Optimization; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HEAL.Attic; 26 27 27 28 namespace HeuristicLab.BioBoost.Operators.Mutation { 28 29 29 [Storable Class]30 [StorableType("B9929153-331D-4457-9B6D-F0F9AD15BEEC")] 30 31 public class EmptyMutator : SingleSuccessorOperator, IManipulator { 31 32 32 33 #region Construction & Cloning 33 34 [StorableConstructor] 34 protected EmptyMutator( bool isDeserializing) : base(isDeserializing) {}35 protected EmptyMutator(StorableConstructorFlag _) : base(_) { } 35 36 protected EmptyMutator(EmptyMutator orig, Cloner cloner) : base(orig, cloner) {} 36 37 public EmptyMutator() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/MultiIntegerVectorMutator.cs
r13071 r16575 32 32 using System; 33 33 using System.Linq; 34 using HEAL.Attic; 34 35 35 36 namespace HeuristicLab.BioBoost.Operators.Mutation { 36 [Storable Class]37 [StorableType("3655B281-9061-470B-95B5-378D9490E814")] 37 38 public class MultiIntegerVectorManipulator : StochasticMultiBranch<IIntegerVectorManipulator>, IIntegerVectorManipulator, IStochasticOperator { 38 39 … … 54 55 #region Construction & Cloning 55 56 [StorableConstructor] 56 protected MultiIntegerVectorManipulator( bool isDeserializing) : base(isDeserializing) {}57 protected MultiIntegerVectorManipulator(StorableConstructorFlag _) : base(_) { } 57 58 protected MultiIntegerVectorManipulator(MultiIntegerVectorManipulator orig, Cloner cloner) : base(orig, cloner) {} 58 59 public MultiIntegerVectorManipulator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/MultiMutator.cs
r13071 r16575 34 34 using System.Collections.Generic; 35 35 using System.Linq; 36 using HEAL.Attic; 36 37 37 38 namespace HeuristicLab.BioBoost.Operators.Mutation { 38 [Storable Class]39 [StorableType("4051852F-E6DA-45A6-A63B-E62FA18D9D3E")] 39 40 public class MultiMutator : StochasticMultiBranch<IManipulator>, IManipulator, IStochasticOperator { 40 41 … … 56 57 #region Construction & Cloning 57 58 [StorableConstructor] 58 protected MultiMutator( bool isDeserializing) : base(isDeserializing) { }59 protected MultiMutator(StorableConstructorFlag _) : base(_) { } 59 60 protected MultiMutator(MultiMutator orig, Cloner cloner) : base(orig, cloner) { } 60 61 public MultiMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/NeighborBasedIntegerVectorMutator.cs
r13071 r16575 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HEAL.Attic; 29 30 30 31 namespace HeuristicLab.BioBoost.Operators.Mutation { 31 [Storable Class]32 [StorableType("CD4B0E31-C2A7-430D-B397-65ADCB75691A")] 32 33 public class NeighborBasedIntegerVectorMutator : BoundedIntegerVectorManipulator { 33 34 … … 42 43 #region Construction & Cloning 43 44 [StorableConstructor] 44 protected NeighborBasedIntegerVectorMutator( bool isDeserializing) : base(isDeserializing) {}45 protected NeighborBasedIntegerVectorMutator(StorableConstructorFlag _) : base(_) { } 45 46 protected NeighborBasedIntegerVectorMutator(NeighborBasedIntegerVectorMutator orig, Cloner cloner) : base(orig, cloner) {} 46 47 public NeighborBasedIntegerVectorMutator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantBasedUtilizationModifier.cs
r13071 r16575 34 34 using HeuristicLab.Parameters; 35 35 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 36 using HEAL.Attic; 36 37 37 38 namespace HeuristicLab.BioBoost.Operators.Mutation { 38 [Storable Class]39 [StorableType("67144EAD-755F-4727-A7C9-8BB312E13DBA")] 39 40 public abstract class PlantBasedUtilizationModifier : SingleSuccessorOperator, IManipulator, IStochasticOperator { 40 41 … … 66 67 67 68 [StorableConstructor] 68 public PlantBasedUtilizationModifier( bool isDeserializing) {}69 public PlantBasedUtilizationModifier(StorableConstructorFlag _) { } 69 70 public PlantBasedUtilizationModifier(PlantBasedUtilizationModifier orig, Cloner cloner) : base(orig, cloner) {} 70 71 public PlantBasedUtilizationModifier() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantKiller.cs
r13071 r16575 24 24 using HeuristicLab.Encodings.RealVectorEncoding; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HEAL.Attic; 26 27 27 28 namespace HeuristicLab.BioBoost.Operators.Mutation { 28 29 [StorableType("C6022D30-973A-44A9-ABDF-EE3D7B20B6E3")] 29 30 public class PlantKiller : PlantBasedUtilizationModifier { 30 31 31 32 #region Construction & Cloning 32 33 [StorableConstructor] 33 public PlantKiller( bool isDeserializing) {}34 public PlantKiller(PlantKiller orig, Cloner cloner) : base(orig, cloner) { }35 public PlantKiller() { }34 public PlantKiller(StorableConstructorFlag _) : base(_) { } 35 public PlantKiller(PlantKiller orig, Cloner cloner) : base(orig, cloner) { } 36 public PlantKiller() { } 36 37 public override IDeepCloneable Clone(Cloner cloner) { 37 38 return new PlantKiller(this, cloner); -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantMerger.cs
r13071 r16575 33 33 using HeuristicLab.Parameters; 34 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 35 using HEAL.Attic; 35 36 36 37 namespace HeuristicLab.BioBoost.Operators.Mutation { 37 38 [StorableType("F3ADEDCA-B790-4892-896D-90AB5E833223")] 38 39 public class PlantMerger : SingleSuccessorOperator, IManipulator, IStochasticOperator { 39 40 40 41 #region Parameters 41 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>) 42 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>) 43 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>) 44 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>) Parameters["RegionBounds"]; } }45 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>) 42 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>)Parameters["ProblemData"]; } } 43 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; } } 44 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>)Parameters["DistanceMatrixInProblemData"]; } } 45 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>)Parameters["RegionBounds"]; } } 46 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>)Parameters["Random"]; } } 46 47 #endregion 47 48 … … 51 52 public IRandom Random { get { return RandomParameter.ActualValue; } } 52 53 public bool DistanceMatrixInProblemData { get { return DistanceMatrixInProblemDataParameter.Value.Value; } } 53 public DistanceMatrix DistanceMatrix { 54 public DistanceMatrix DistanceMatrix 55 { 54 56 get { 55 57 if (DistanceMatrixInProblemData) { 56 return ((IValueParameter<DistanceMatrix>) 58 return ((IValueParameter<DistanceMatrix>)ProblemData.Parameters[DistanceMatrixParameter.ActualName]).Value; 57 59 } else { 58 60 return DistanceMatrixParameter.ActualValue; … … 64 66 #region Construction & Cloning 65 67 [StorableConstructor] 66 public PlantMerger( bool isDeserializing) {}67 public PlantMerger(PlantMerger orig, Cloner cloner) : base(orig, cloner) { }68 public PlantMerger(StorableConstructorFlag _) : base(_) { } 69 public PlantMerger(PlantMerger orig, Cloner cloner) : base(orig, cloner) { } 68 70 69 71 public PlantMerger() { … … 97 99 : scope.Variables[productTransportName].Value as IntegerVector; 98 100 if (supplyTransports != null) { 99 var plants = supplyTransports.Select((target, source) => new { target, source}).GroupBy(p => p.target).ToList();101 var plants = supplyTransports.Select((target, source) => new { target, source }).GroupBy(p => p.target).ToList(); 100 102 var plant = plants.ElementAt(Random.Next(plants.Count)); 101 103 var allowedRegions = new HashSet<int>(plants.Select(p => p.Key)); … … 114 116 115 117 private int FindNewTarget(int oldTarget, IRandom random, DistanceMatrix distances, IEnumerable<int> allowedRegions) { 116 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d}).ToList();118 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d }).ToList(); 117 119 var maxDistance = 0d; 118 120 foreach (int j in allowedRegions) { 119 121 var dist = distances[oldTarget, j]; 120 neighborDistances.Add(new { index = j, distance = dist});122 neighborDistances.Add(new { index = j, distance = dist }); 121 123 maxDistance = Math.Max(dist, maxDistance); 122 124 } 123 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance}).ToList();125 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance }).ToList(); 124 126 neighborDistances.Sort((a, b) => b.distance.CompareTo(a.distance)); 125 127 var totalDistance = neighborDistances.Sum(p => p.distance); 126 var threshold = random.NextDouble() *totalDistance;128 var threshold = random.NextDouble() * totalDistance; 127 129 var sum = 0d; 128 130 var index = 0; -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantMover.cs
r13071 r16575 33 33 using HeuristicLab.Parameters; 34 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 35 using HEAL.Attic; 35 36 36 37 namespace HeuristicLab.BioBoost.Operators.Mutation { 37 38 [StorableType("E7D81182-EFE9-4581-B26D-15FF2354B4C6")] 38 39 public class PlantMover : SingleSuccessorOperator, IManipulator, IStochasticOperator { 39 40 40 41 #region Parameters 41 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>) 42 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>) 43 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>) 44 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>) Parameters["RegionBounds"]; } }45 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>) 46 public IValueLookupParameter<PercentValue> MergeAvoidanceProbabilityParameter { get { return (IValueLookupParameter<PercentValue>) 47 public IValueLookupParameter<PercentValue> SplitProbabilityParameter { get { return (IValueLookupParameter<PercentValue>) 48 public IValueLookupParameter<PercentValue> MovePercentageParameter { get { return (IValueLookupParameter<PercentValue>) 42 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>)Parameters["ProblemData"]; } } 43 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; } } 44 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>)Parameters["DistanceMatrixInProblemData"]; } } 45 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>)Parameters["RegionBounds"]; } } 46 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>)Parameters["Random"]; } } 47 public IValueLookupParameter<PercentValue> MergeAvoidanceProbabilityParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["MergeAvoidanceProbability"]; } } 48 public IValueLookupParameter<PercentValue> SplitProbabilityParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["SplitProbability"]; } } 49 public IValueLookupParameter<PercentValue> MovePercentageParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["MovePercentage"]; } } 49 50 #endregion 50 51 … … 56 57 public IRandom Random { get { return RandomParameter.ActualValue; } } 57 58 public bool DistanceMatrixInProblemData { get { return DistanceMatrixInProblemDataParameter.Value.Value; } } 58 public DistanceMatrix DistanceMatrix { 59 public DistanceMatrix DistanceMatrix 60 { 59 61 get { 60 62 if (DistanceMatrixInProblemData) { 61 return ((IValueParameter<DistanceMatrix>) 63 return ((IValueParameter<DistanceMatrix>)ProblemData.Parameters[DistanceMatrixParameter.ActualName]).Value; 62 64 } else { 63 65 return DistanceMatrixParameter.ActualValue; … … 72 74 #region Construction & Cloning 73 75 [StorableConstructor] 74 public PlantMover( bool isDeserializing) {}75 public PlantMover(PlantMover orig, Cloner cloner) : base(orig, cloner) { }76 public PlantMover(StorableConstructorFlag _) : base(_) { } 77 public PlantMover(PlantMover orig, Cloner cloner) : base(orig, cloner) { } 76 78 77 79 public PlantMover() { … … 108 110 : scope.Variables[productTransportName].Value as IntegerVector; 109 111 if (supplyTransports != null) { 110 var plants = supplyTransports.Select((target, source) => new { target, source}).GroupBy(p => p.target).ToList();112 var plants = supplyTransports.Select((target, source) => new { target, source }).GroupBy(p => p.target).ToList(); 111 113 var plant = plants.ElementAt(Random.Next(plants.Count)); 112 114 var forbiddenRegions = new HashSet<int>(); … … 131 133 132 134 private int FindNewTarget(int oldTarget, IRandom random, DistanceMatrix distances, HashSet<int> forbiddenRegions) { 133 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d}).ToList();135 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d }).ToList(); 134 136 var maxDistance = 0d; 135 137 for (int j = 0; j < distances.Columns; j++) { 136 138 if (forbiddenRegions.Contains(j)) continue; 137 139 var dist = distances[oldTarget, j]; 138 neighborDistances.Add(new { index = j, distance = dist});140 neighborDistances.Add(new { index = j, distance = dist }); 139 141 maxDistance = Math.Max(dist, maxDistance); 140 142 } 141 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance}).ToList();143 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance }).ToList(); 142 144 neighborDistances.Sort((a, b) => b.distance.CompareTo(a.distance)); 143 145 var totalDistance = neighborDistances.Sum(p => p.distance); 144 var threshold = random.NextDouble() *totalDistance;146 var threshold = random.NextDouble() * totalDistance; 145 147 var sum = 0d; 146 148 var index = 0; -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantScalingMutator.cs
r13071 r16575 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HEAL.Attic; 27 28 28 29 namespace HeuristicLab.BioBoost.Operators.Mutation { 29 30 30 [Storable Class]31 [StorableType("01EBA7E4-DBAE-47F9-8DE6-C3D3E697CD11")] 31 32 public class PlantScalingMutator : PlantBasedUtilizationModifier { 32 33 33 34 #region Construction & Cloning 34 35 [StorableConstructor] 35 public PlantScalingMutator( bool isDeserializing) {}36 public PlantScalingMutator(StorableConstructorFlag _) { } 36 37 public PlantScalingMutator(PlantScalingMutator orig, Cloner cloner) : base(orig, cloner) {} 37 38 public PlantScalingMutator() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantSplitter.cs
r13071 r16575 33 33 using HeuristicLab.Parameters; 34 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 35 using HEAL.Attic; 35 36 36 37 namespace HeuristicLab.BioBoost.Operators.Mutation { 37 38 [StorableType("FCC0115E-1465-4C76-A422-E9242B3AB8CA")] 38 39 public class PlantSplitter : SingleSuccessorOperator, IManipulator, IStochasticOperator { 39 40 40 41 #region Parameters 41 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>) 42 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>) 43 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>) 44 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>) Parameters["RegionBounds"]; } }45 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>) 46 public IValueLookupParameter<PercentValue> MergeAvoidanceProbabilityParameter { get { return (IValueLookupParameter<PercentValue>) 47 public IValueLookupParameter<PercentValue> SplitProbabilityParameter { get { return (IValueLookupParameter<PercentValue>) 48 public IValueLookupParameter<PercentValue> MovePercentageParameter { get { return (IValueLookupParameter<PercentValue>) 42 public LookupParameter<BioBoostProblemData> ProblemDataParameter { get { return (LookupParameter<BioBoostProblemData>)Parameters["ProblemData"]; } } 43 public LookupParameter<DistanceMatrix> DistanceMatrixParameter { get { return (LookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; } } 44 public ValueParameter<BoolValue> DistanceMatrixInProblemDataParameter { get { return (ValueParameter<BoolValue>)Parameters["DistanceMatrixInProblemData"]; } } 45 public ValueLookupParameter<IntMatrix> RegionBoundsParameter { get { return (ValueLookupParameter<IntMatrix>)Parameters["RegionBounds"]; } } 46 public ILookupParameter<IRandom> RandomParameter { get { return (ILookupParameter<IRandom>)Parameters["Random"]; } } 47 public IValueLookupParameter<PercentValue> MergeAvoidanceProbabilityParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["MergeAvoidanceProbability"]; } } 48 public IValueLookupParameter<PercentValue> SplitProbabilityParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["SplitProbability"]; } } 49 public IValueLookupParameter<PercentValue> MovePercentageParameter { get { return (IValueLookupParameter<PercentValue>)Parameters["MovePercentage"]; } } 49 50 #endregion 50 51 … … 54 55 public IRandom Random { get { return RandomParameter.ActualValue; } } 55 56 public bool DistanceMatrixInProblemData { get { return DistanceMatrixInProblemDataParameter.Value.Value; } } 56 public DistanceMatrix DistanceMatrix { 57 public DistanceMatrix DistanceMatrix 58 { 57 59 get { 58 60 if (DistanceMatrixInProblemData) { 59 return ((IValueParameter<DistanceMatrix>) 61 return ((IValueParameter<DistanceMatrix>)ProblemData.Parameters[DistanceMatrixParameter.ActualName]).Value; 60 62 } else { 61 63 return DistanceMatrixParameter.ActualValue; … … 70 72 #region Construction & Cloning 71 73 [StorableConstructor] 72 public PlantSplitter( bool isDeserializing) {}73 public PlantSplitter(PlantSplitter orig, Cloner cloner) : base(orig, cloner) { }74 public PlantSplitter(StorableConstructorFlag _) : base(_) { } 75 public PlantSplitter(PlantSplitter orig, Cloner cloner) : base(orig, cloner) { } 74 76 75 77 public PlantSplitter() { … … 106 108 : scope.Variables[productTransportName].Value as IntegerVector; 107 109 if (supplyTransports != null) { 108 var plants = supplyTransports.Select((target, source) => new { target, source}).GroupBy(p => p.target).ToList();110 var plants = supplyTransports.Select((target, source) => new { target, source }).GroupBy(p => p.target).ToList(); 109 111 var plant = plants.ElementAt(Random.Next(plants.Count)); 110 112 var forbiddenRegions = new HashSet<int>(); … … 129 131 130 132 private int FindNewTarget(int oldTarget, IRandom random, DistanceMatrix distances, HashSet<int> forbiddenRegions) { 131 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d}).ToList();133 var neighborDistances = new double[0].Select((d, idx) => new { index = idx, distance = d }).ToList(); 132 134 var maxDistance = 0d; 133 135 for (int j = 0; j < distances.Columns; j++) { 134 136 if (forbiddenRegions.Contains(j)) continue; 135 137 var dist = distances[oldTarget, j]; 136 neighborDistances.Add(new { index = j, distance = dist});138 neighborDistances.Add(new { index = j, distance = dist }); 137 139 maxDistance = Math.Max(dist, maxDistance); 138 140 } 139 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance}).ToList();141 neighborDistances = neighborDistances.Select(p => new { p.index, distance = maxDistance - p.distance }).ToList(); 140 142 neighborDistances.Sort((a, b) => b.distance.CompareTo(a.distance)); 141 143 var totalDistance = neighborDistances.Sum(p => p.distance); 142 var threshold = random.NextDouble() *totalDistance;144 var threshold = random.NextDouble() * totalDistance; 143 145 var sum = 0d; 144 146 var index = 0; -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantSupplierEqualizer.cs
r13071 r16575 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HEAL.Attic; 27 28 28 29 namespace HeuristicLab.BioBoost.Operators.Mutation { 29 30 30 [Storable Class]31 [StorableType("47E3AE56-1831-4FD4-8F6A-AAEED5AF0F5A")] 31 32 public class PlantSupplierEqualizer : PlantBasedUtilizationModifier { 32 33 33 34 #region Construction & Cloning 34 35 [StorableConstructor] 35 public PlantSupplierEqualizer( bool isDeserializing) {}36 public PlantSupplierEqualizer(StorableConstructorFlag _) { } 36 37 public PlantSupplierEqualizer(PlantSupplierEqualizer orig, Cloner cloner) : base(orig, cloner) {} 37 38 public PlantSupplierEqualizer() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantSupplierRandomizer.cs
r13071 r16575 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HEAL.Attic; 27 28 28 29 namespace HeuristicLab.BioBoost.Operators.Mutation { 29 30 30 [Storable Class]31 [StorableType("234006BF-3E6B-4493-A318-95325A72CB5F")] 31 32 public class PlantSupplierRandomizer : PlantBasedUtilizationModifier { 32 33 33 34 #region Construction & Cloning 34 35 [StorableConstructor] 35 public PlantSupplierRandomizer( bool isDeserializing) {}36 public PlantSupplierRandomizer(StorableConstructorFlag _) { } 36 37 public PlantSupplierRandomizer(PlantSupplierRandomizer orig, Cloner cloner) : base(orig, cloner) {} 37 38 public PlantSupplierRandomizer() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantSupplierToggler.cs
r13071 r16575 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Random; 28 using HEAL.Attic; 28 29 29 30 namespace HeuristicLab.BioBoost.Operators.Mutation { 30 31 31 [Storable Class]32 [StorableType("ED5F9402-0524-429E-BDD5-F6B1753B7B47")] 32 33 public class PlantSupplierToggler : PlantBasedUtilizationModifier { 33 34 34 35 #region Construction & Cloning 35 36 [StorableConstructor] 36 public PlantSupplierToggler( bool isDeserializing) {}37 public PlantSupplierToggler(StorableConstructorFlag _) { } 37 38 public PlantSupplierToggler(PlantSupplierToggler orig, Cloner cloner) : base(orig, cloner) {} 38 39 public PlantSupplierToggler() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/PlantSupplierUtilizationExchanger.cs
r13071 r16575 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Random; 28 using HEAL.Attic; 28 29 29 30 namespace HeuristicLab.BioBoost.Operators.Mutation { 30 31 31 [Storable Class]32 [StorableType("F68106A0-10E6-457B-9318-4A6AF242BC8E")] 32 33 public class PlantSupplierUtilizationExchanger : PlantBasedUtilizationModifier { 33 34 34 35 #region Construction & Cloning 35 36 [StorableConstructor] 36 public PlantSupplierUtilizationExchanger( bool isDeserializing) {}37 public PlantSupplierUtilizationExchanger(StorableConstructorFlag _) { } 37 38 public PlantSupplierUtilizationExchanger(PlantSupplierUtilizationExchanger orig, Cloner cloner) : base(orig, cloner) {} 38 39 public PlantSupplierUtilizationExchanger() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Mutation/TargetMergingIntegerVectorMutator.cs
r13071 r16575 30 30 using System; 31 31 using System.Linq; 32 using HEAL.Attic; 32 33 33 34 namespace HeuristicLab.BioBoost.Operators.Mutation { 34 [Storable Class]35 [StorableType("EE0CB71C-2631-445E-BFBF-55967F4D371E")] 35 36 public class TargetMergingIntegerVectorManipulator : BoundedIntegerVectorManipulator { 36 37 … … 67 68 #region Construction & Cloning 68 69 [StorableConstructor] 69 protected TargetMergingIntegerVectorManipulator( bool isDeserializing) : base(isDeserializing) {}70 protected TargetMergingIntegerVectorManipulator(StorableConstructorFlag _) : base(_) { } 70 71 protected TargetMergingIntegerVectorManipulator(TargetMergingIntegerVectorManipulator orig, Cloner cloner) : base(orig, cloner) {} 71 72 public TargetMergingIntegerVectorManipulator() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Transformation/FeedstockDeflater.cs
r13071 r16575 31 31 using System.Collections.Generic; 32 32 using HeuristicLab.BioBoost.Representation; 33 using HEAL.Attic; 33 34 34 35 namespace HeuristicLab.BioBoost.Operators.Transformation { 35 36 36 [Storable Class]37 [StorableType("9F8B4BC5-5814-45C2-8AEC-AC29CBA40A05")] 37 38 public class FeedstockDeflater : FeedstockTransformer { 38 39 … … 45 46 #region Construction & Cloning 46 47 [StorableConstructor] 47 protected FeedstockDeflater( bool isDeserializing) : base(isDeserializing) {}48 protected FeedstockDeflater(StorableConstructorFlag _) : base(_) { } 48 49 protected FeedstockDeflater(FeedstockDeflater orig, Cloner cloner) : base(orig, cloner) {} 49 50 public FeedstockDeflater() { -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Transformation/FeedstockInflater.cs
r13071 r16575 27 27 using System.Collections.Generic; 28 28 using HeuristicLab.BioBoost.Representation; 29 using HEAL.Attic; 29 30 30 31 namespace HeuristicLab.BioBoost.Operators.Transformation { 31 32 32 [Storable Class]33 [StorableType("6BC1D076-7DFC-4AC9-B5CF-35BE9DB903F6")] 33 34 public class FeedstockInflater : FeedstockTransformer { 34 35 35 36 #region Construction & Cloning 36 37 [StorableConstructor] 37 protected FeedstockInflater( bool isDeserializing) : base(isDeserializing) {}38 protected FeedstockInflater(StorableConstructorFlag _) : base(_) { } 38 39 protected FeedstockInflater(FeedstockInflater orig, Cloner cloner) : base(orig, cloner) {} 39 40 public FeedstockInflater() {} -
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost/3.3/Operators/Transformation/FeedstockTransformer.cs
r13071 r16575 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HEAL.Attic; 27 28 28 29 namespace HeuristicLab.BioBoost.Operators.Transformation { 29 30 30 [Storable Class]31 [StorableType("4899F5B6-FD69-4CAA-896C-20A51A4B0BCC")] 31 32 public class FeedstockTransformer : BioBoostOperator { 32 33 … … 41 42 #region Construction & Cloning 42 43 [StorableConstructor] 43 protected FeedstockTransformer( bool isDeserializing) : base(isDeserializing) {}44 protected FeedstockTransformer(StorableConstructorFlag _) : base(_) { } 44 45 protected FeedstockTransformer(FeedstockTransformer orig, Cloner cloner) : base(orig, cloner) {} 45 46 public FeedstockTransformer() {
Note: See TracChangeset
for help on using the changeset viewer.