Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/15 18:47:19 (9 years ago)
Author:
mkommend
Message:

#2174: First working version of refactored programmable problem.

File:
1 edited

Legend:

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

    r11739 r11753  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using System.Reflection;
     
    4746      variableStore = cloner.Clone(original.variableStore);
    4847    }
    49     protected ProblemDefinitionScript() :base(){
     48    protected ProblemDefinitionScript()
     49      : base() {
    5050      variableStore = new VariableStore();
    5151    }
    5252
    5353    IEncoding IProblemDefinition.Encoding {
    54       get { return CompiledProblemDefinition != null ? CompiledProblemDefinition.Encoding : null; }
    55     }
    56     IEnumerable<Individual> IProblemDefinition.GetNeighbors(Individual individual, IRandom random) {
    57       return CompiledProblemDefinition.GetNeighbors(individual, random);
     54      get { return CompiledProblemDefinition.Encoding; }
    5855    }
    5956
     
    6259    protected IProblemDefinition CompiledProblemDefinition {
    6360      get {
    64           lock (locker) {
    65             if (compiledProblemDefinition == null) {
    66               Compile();
    67             }
    68           }
     61        //lock (locker) {
     62        //  if (compiledProblemDefinition == null) {
     63        //    Compile();
     64        //  }
     65        //}
     66        if (compiledProblemDefinition == null) throw new InvalidOperationException("The problem definition script is not compiled and cannot be used.");
    6967        return compiledProblemDefinition;
    7068      }
Note: See TracChangeset for help on using the changeset viewer.