Changeset 17778 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/robocode/Problem.cs
- Timestamp:
- 10/29/20 14:44:19 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/robocode/Problem.cs
r17745 r17778 34 34 [Item("Robocode Problem", "Evolution of a robocode program in java using genetic programming.")] 35 35 public class Problem : SymbolicExpressionTreeProblem { 36 #region Parameter Names 37 private const string RobocodePathParamaterName = "RobocodePath"; 38 private const string NrOfRoundsParameterName = "NrOfRounds"; 39 private const string EnemiesParameterName = "Enemies"; 40 #endregion 41 36 42 37 #region Parameters 43 public IFixedValueParameter<DirectoryValue> RobocodePathParameter { 44 get { return (IFixedValueParameter<DirectoryValue>)Parameters[RobocodePathParamaterName]; } 45 } 46 public IFixedValueParameter<IntValue> NrOfRoundsParameter { 47 get { return (IFixedValueParameter<IntValue>)Parameters[NrOfRoundsParameterName]; } 48 } 49 public IValueParameter<EnemyCollection> EnemiesParameter { 50 get { return (IValueParameter<EnemyCollection>)Parameters[EnemiesParameterName]; } 51 } 38 [Storable] public IFixedValueParameter<DirectoryValue> RobocodePathParameter { get; private set; } 39 [Storable] public IFixedValueParameter<IntValue> NrOfRoundsParameter { get; private set; } 40 [Storable] public IValueParameter<EnemyCollection> EnemiesParameter { get; private set; } 52 41 53 42 public string RobocodePath { … … 71 60 protected Problem(Problem original, Cloner cloner) 72 61 : base(original, cloner) { 62 RobocodePathParameter = cloner.Clone(original.RobocodePathParameter); 63 NrOfRoundsParameter = cloner.Clone(original.NrOfRoundsParameter); 64 EnemiesParameter = cloner.Clone(original.EnemiesParameter); 65 73 66 RegisterEventHandlers(); 74 67 } … … 82 75 83 76 84 Parameters.Add( new FixedValueParameter<DirectoryValue>(RobocodePathParamaterName, "Path of the Robocode installation.", robocodeDir));85 Parameters.Add( new FixedValueParameter<IntValue>(NrOfRoundsParameterName, "Number of rounds a robot has to fight against each opponent.", new IntValue(3)));86 Parameters.Add( new ValueParameter<EnemyCollection>(EnemiesParameterName, "The enemies that should be battled.", robotList));77 Parameters.Add(RobocodePathParameter = new FixedValueParameter<DirectoryValue>("RobocodePath", "Path of the Robocode installation.", robocodeDir)); 78 Parameters.Add(NrOfRoundsParameter = new FixedValueParameter<IntValue>("NrOfRounds", "Number of rounds a robot has to fight against each opponent.", new IntValue(3))); 79 Parameters.Add(EnemiesParameter = new ValueParameter<EnemyCollection>("Enemies", "The enemies that should be battled.", robotList)); 87 80 88 81 Encoding.FunctionArguments = 0;
Note: See TracChangeset
for help on using the changeset viewer.