Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/28/14 09:18:30 (10 years ago)
Author:
abeham
Message:

#2174:

  • Renamed methods from e.g. Configuration.AddReal to Configuration.AddRealVector
  • Introduced the variable store into the single-objective problem definition script
  • Created a base class for problem definitions that are derived from in code
  • Created a view for problem definition scripts that also includes the variable store
    • It looks like a C# script view, but unfortunately, the content types are not compatible
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/ProblemDefinitionScript.cs

    r11393 r11397  
    3434    protected bool SuppressEvents { get; set; }
    3535
     36    [Storable]
     37    private VariableStore variableStore;
     38    public VariableStore VariableStore {
     39      get { return variableStore; }
     40    }
     41
    3642    [StorableConstructor]
    3743    protected ProblemDefinitionScript(bool deserializing) : base(deserializing) { }
    3844    protected ProblemDefinitionScript(ProblemDefinitionScript original, Cloner cloner)
    39       : base(original, cloner) { }
    40     public ProblemDefinitionScript() { }
     45      : base(original, cloner) {
     46      variableStore = cloner.Clone(original.variableStore);
     47    }
     48    protected ProblemDefinitionScript() {
     49      variableStore = new VariableStore();
     50    }
    4151
    4252    private volatile IProblemDefinition instance;
     
    7484      try {
    7585        Instance = (IProblemDefinition)Activator.CreateInstance(types.First(x => typeof(IProblemDefinition).IsAssignableFrom(x)));
     86        Instance.vars = new Variables(VariableStore);
     87        Instance.Initialize();
    7688      } catch {
    7789        Instance = null;
Note: See TracChangeset for help on using the changeset viewer.