- Timestamp:
- 08/04/21 17:19:05 (3 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs
r17843 r18040 16 16 IParameter parameter = value as IParameter; 17 17 18 if (parameter.ActualValue == null) 19 parameter.ActualValue = Instantiate(parameter.DataType); 20 21 if(parameter.ActualValue != null) { 22 if (data.Children == null || data.Children.Count() == 0) 23 root.Inject(parameter.ActualValue, data, root); 24 else 25 root.Inject(parameter.ActualValue, data, root); 26 18 if (!(data is EmptyJsonItem)) { 19 if (parameter.ActualValue == null) 20 parameter.ActualValue = Instantiate(parameter.DataType); 21 root.Inject(parameter.ActualValue, data, root); 27 22 } 28 23 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj
r17924 r18040 90 90 <Compile Include="JsonItems\EmptyJsonItem.cs" /> 91 91 <Compile Include="JsonItems\IntervalRestrictedArrayJsonItem.cs" /> 92 <Compile Include="JsonItems\IntervalRestrictedJsonItem.cs" /> 92 93 <Compile Include="JsonItems\IntervalRestrictedMatrixJsonItem.cs" /> 93 94 <Compile Include="JsonItems\IntervalRestrictedValueJsonItem.cs" /> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/IntervalRestrictedValueJsonItem.cs
r17828 r18040 3 3 4 4 namespace HeuristicLab.JsonInterface { 5 public abstract class IntervalRestrictedValueJsonItem<T> : ValueJsonItem<T>, IIntervalRestrictedJsonItem<T> 5 public abstract class IntervalRestrictedValueJsonItem<T> : ValueJsonItem<T>, IIntervalRestrictedJsonItem<T> // TODO: intervalrestriction before value? 6 6 where T : IComparable { 7 7 public T Minimum { get; set; } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/RangedJsonItem.cs
r18031 r18040 4 4 5 5 namespace HeuristicLab.JsonInterface { 6 public abstract class RangedJsonItem<T> : IntervalRestricted ValueJsonItem<T>, IRangedJsonItem<T>6 public abstract class RangedJsonItem<T> : IntervalRestrictedJsonItem<T>, IRangedJsonItem<T> 7 7 where T : IComparable { 8 8 public T MinValue { get; set; } 9 9 10 public T MaxValue { get; set; } 10 11 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs
r18030 r18040 50 50 serializer.Serialize(optimizer, hlFilePath); 51 51 // overwrite string for relative path 52 hlFilePath = Path.Combine($". {Path.DirectorySeparatorChar}", $"{templateName}.hl");52 hlFilePath = Path.Combine($".", $"{templateName}.hl"); 53 53 #endregion 54 54 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
r18039 r18040 50 50 51 51 #region Parse Files 52 string templateFileFullPath = Path.GetFullPath(templateFile); 52 53 Template = JToken.Parse(File.ReadAllText(templateFile)); 53 54 if(!string.IsNullOrEmpty(configFile)) 54 Config = JArray.Parse(File.ReadAllText( configFile));55 Config = JArray.Parse(File.ReadAllText(Path.GetFullPath(configFile))); 55 56 #endregion 56 57 … … 61 62 relativePath = relativePath.Remove(0, 2); // remove first 2 chars -> indicates the current directory 62 63 63 string hLFileLocation = $"{Path.GetDirectoryName(templateFile)}{Path.DirectorySeparatorChar}{relativePath}"; 64 64 string hLFileLocation = Path.Combine(Path.GetDirectoryName(templateFileFullPath), relativePath); 65 65 #region Deserialize HL File 66 66 ProtoBufSerializer serializer = new ProtoBufSerializer();
Note: See TracChangeset
for help on using the changeset viewer.