Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/15/19 15:29:36 (5 years ago)
Author:
dpiringe
Message:

#3026

  • changed the access modifiers in Constants from public to internal
  • added comments in JCGenerator
  • the config file for JCInstantiator is now optional
  • added Runner.cs (forgot last commit)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCInstantiator.cs

    r17324 r17330  
    2323    private IDictionary<string, JsonItem> ConfigurableItems { get; set; } = new Dictionary<string, JsonItem>();
    2424   
    25     public IAlgorithm Instantiate(string templateFile, string configFile) {
     25    public IAlgorithm Instantiate(string templateFile, string configFile = "") {
    2626
    2727      //1. Parse Template and Config files
    2828      Template = JToken.Parse(File.ReadAllText(templateFile));
    29       Config = JArray.Parse(File.ReadAllText(configFile));
     29      if(!string.IsNullOrEmpty(configFile))
     30        Config = JArray.Parse(File.ReadAllText(configFile));
    3031      TypeList = Template[Constants.Types].ToObject<Dictionary<string, string>>();
    3132      string algorithmName = Template[Constants.Metadata][Constants.Algorithm].ToString();
     
    3839      SelectConfigurableItems();
    3940
    40       //4. Merge Template and Config
    41       MergeTemplateWithConfig();
     41      //4. if config != null -> merge Template and Config
     42      if (Config != null)
     43        MergeTemplateWithConfig();
    4244
    4345      //5. resolve the references between parameterizedItems
Note: See TracChangeset for help on using the changeset viewer.