コード例 #1
0
        protected override ICFGPythonProblemData LoadProblemData(CFGData data)
        {
            CFGPythonProblemData problemData = new CFGPythonProblemData(data.Input, data.Output);

            problemData.TrainingPartitionParameter.Value.Start = data.TrainingPartitionStart;
            problemData.TrainingPartitionParameter.Value.End   = data.TrainingPartitionEnd;
            problemData.TestPartitionParameter.Value.Start     = data.TestPartitionStart;
            problemData.TestPartitionParameter.Value.End       = data.TestPartitionEnd;
            problemData.EmbedCode.Value = data.Embed;
            return(problemData as ICFGPythonProblemData);
        }
コード例 #2
0
    static CFGPythonProblemData() {
      var problemData = new CFGPythonProblemData();
      problemData.Parameters.Clear();
      problemData.Name = "Empty CFG ProblemData";
      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
      problemData.isEmpty = true;

      problemData.Parameters.Add(new FixedValueParameter<StringArray>(InputParameterName, "", new StringArray().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<StringArray>(OutputParameterName, "", new StringArray().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<TextValue>(EmbedCodeParameterName, "Text where code should be embedded to. (Optinal: Does not have to be set.)", new TextValue().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<TextValue>(HeaderParameterName, "", new TextValue().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<TextValue>(FooterParameterName, "", new TextValue().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<TextValue>(HelperCodeParameterName, "", new TextValue().AsReadOnly()));
      problemData.Parameters.Add(new FixedValueParameter<VariableTypeParameterCollection>(VariablesParameterName, "", new VariableTypeParameterCollection()));
      problemData.Parameters.Add(new FixedValueParameter<ItemList<TextValue>>(VariableSettingsParameterName, "", new ItemList<TextValue>()));
      emptyProblemData = problemData;
    }
コード例 #3
0
        static CFGPythonProblemData()
        {
            var problemData = new CFGPythonProblemData();

            problemData.Parameters.Clear();
            problemData.Name        = "Empty CFG ProblemData";
            problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
            problemData.isEmpty     = true;

            problemData.Parameters.Add(new FixedValueParameter <StringArray>(InputParameterName, "", new StringArray().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <StringArray>(OutputParameterName, "", new StringArray().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <IntRange>(TrainingPartitionParameterName, "", (IntRange) new IntRange(0, 0).AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <IntRange>(TestPartitionParameterName, "", (IntRange) new IntRange(0, 0).AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <IntValue>(LoopBreakConstParameterName, "", (IntValue) new IntValue().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <TextValue>(EmbedCodeParameterName, "Text where code should be embedded to. (Optinal: Does not have to be set.)", new TextValue().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <TextValue>(HeaderParameterName, "", new TextValue().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <TextValue>(FooterParameterName, "", new TextValue().AsReadOnly()));
            problemData.Parameters.Add(new FixedValueParameter <TextValue>(HelperCodeParameterName, "", new TextValue().AsReadOnly()));
            // TODO: should be moved to HeuristicLab.Problems.CFG.Python.Semantics
            problemData.Parameters.Add(new FixedValueParameter <VariableTypeParameterCollection>(VariablesParameterName, VariablesParameterDescription, new VariableTypeParameterCollection()));
            problemData.Parameters.Add(new FixedValueParameter <ItemList <TextValue> >(VariableSettingsParameterName, VariableSettingsParameterDescription, new ItemList <TextValue>()));
            emptyProblemData = problemData;
        }
コード例 #4
0
 protected CFGPythonProblemData(CFGPythonProblemData original, Cloner cloner)
   : base(original, cloner) {
 }
コード例 #5
0
 protected CFGPythonProblemData(CFGPythonProblemData original, Cloner cloner)
     : base(original, cloner)
 {
 }