Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs (revision 17483)
@@ -21,5 +21,5 @@
if (parameter.ActualValue != null && parameter.ActualValue is IParameterizedItem && cdata.Children != null) {
foreach(var child in cdata.Children) {
- if(child.Name == parameter.ActualValue.ItemName) // name kann verändert werden? egal da bei inject der original name vorhanden ist
+ if(child.Name == cdata.Value || child.Path.EndsWith(cdata.Value))
root.Inject(parameter.ActualValue, child, root);
}
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs (revision 17483)
@@ -17,5 +17,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new StringJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs (revision 17483)
@@ -22,10 +22,9 @@
IValueLookupParameter param = value as IValueLookupParameter;
- IValueLookupJsonItem item = new ValueLookupJsonItem() {};
+ IValueLookupJsonItem item = new ValueLookupJsonItem();
if (param.Value != null) {
IJsonItem tmp = root.Extract(param.Value, root);
tmp.Parent = item;
- //item.AddChildren(tmp.Children);
item.ActualValue = tmp;
}
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs (revision 17483)
@@ -21,5 +21,5 @@
root.Inject(parameter.ActualValue, data, root);
else
- root.Inject(parameter.ActualValue, /*data.Children?.First()*/ data, root);
+ root.Inject(parameter.ActualValue, data, root);
}
@@ -40,13 +40,4 @@
tmp.Description = parameter.Description;
item = tmp;
- /*
- if (tmp.Name == "[OverridableParamName]") {
- tmp.Name = parameter.Name;
- tmp.Description = parameter.Description;
- item = tmp;
- //JsonItem.Merge(item as JsonItem, tmp as JsonItem);
- } else
- item.AddChildren(tmp);
- */
}
}
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs (revision 17483)
@@ -25,5 +25,4 @@
IntRange range = value as IntRange;
return new IntRangeJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
@@ -50,5 +49,4 @@
DoubleRange range = value as DoubleRange;
return new DoubleRangeJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs (revision 17483)
@@ -20,5 +20,5 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new IntMatrixJsonItem() {
- Name = "[OverridableParamName]",
+ Name = value.ItemName,
Description = value.ItemDescription,
Value = Transform((IntMatrix)value),
@@ -40,5 +40,5 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new DoubleMatrixJsonItem() {
- Name = "[OverridableParamName]",
+ Name = value.ItemName,
Description = value.ItemDescription,
Value = Transform((DoubleMatrix)value),
@@ -62,5 +62,5 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new DoubleMatrixJsonItem() {
- Name = "[OverridableParamName]",
+ Name = value.ItemName,
Description = value.ItemDescription,
Value = Transform((PercentMatrix)value),
@@ -82,5 +82,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new BoolMatrixJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs (revision 17483)
@@ -18,5 +18,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new IntJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
@@ -36,5 +35,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new DoubleJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
@@ -54,10 +52,9 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new DoubleJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
Value = ((PercentValue)value).Value,
- Minimum = double.MinValue,
- Maximum = double.MaxValue
+ Minimum = 0.0d,
+ Maximum = 1.0d
};
}
@@ -72,5 +69,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new BoolJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
@@ -88,5 +84,4 @@
public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
new DateTimeJsonItem() {
- //Name = "[OverridableParamName]",
Name = value.ItemName,
Description = value.ItemDescription,
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj (revision 17483)
@@ -61,5 +61,4 @@
-
@@ -166,7 +165,5 @@
-
-
-
+
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs (revision 17483)
@@ -93,9 +93,9 @@
private bool CompareGenericTypes(Type t1, Type t2) =>
- (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) ||
- (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1);
+ (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) /*||
+ (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1)*/;
private bool CompareTypes(Type t1, Type t2) =>
- t1 == t2 || t1.IsAssignableFrom(t2) ||
+ t1 == t2 || /*t1.IsAssignableFrom(t2) ||*/
t1.GetInterfaces().Any(
i => i == t2 || CompareGenericTypes(i, t2)
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs (revision 17483)
@@ -110,5 +110,5 @@
// override default value
if (Objects.TryGetValue(path, out IJsonItem param)) {
- // remove fixed template parameter => dont allow to copy them from concrete config
+ // remove fixed template parameter from config => dont allow to copy them from concrete config
obj.Property(nameof(IIntervalRestrictedJsonItem.Minimum))?.Remove();
obj.Property(nameof(IIntervalRestrictedJsonItem.Maximum))?.Remove();
Index: /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ValueLookupJsonItem.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ValueLookupJsonItem.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ValueLookupJsonItem.cs (revision 17483)
@@ -9,5 +9,4 @@
namespace HeuristicLab.JsonInterface {
public class ValueLookupJsonItem : LookupJsonItem, IValueLookupJsonItem {
-
public IJsonItem ActualValue { get; set; }
@@ -20,6 +19,5 @@
var obj = base.GenerateJObject();
if(ActualValue != null) {
- var actualValue = ActualValue.GenerateJObject();
- obj.Add(nameof(IValueLookupJsonItem.ActualValue), actualValue);
+ obj.Add(nameof(IValueLookupJsonItem.ActualValue), ActualValue.Path);
}
return obj;
Index: /branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs (revision 17482)
+++ /branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs (revision 17483)
@@ -24,5 +24,4 @@
var pluginManager = new PluginManager(pluginPath);
pluginManager.DiscoverAndCheckPlugins();
-
} catch(Exception e) {
Console.WriteLine(e);
Index: /branches/3026_IntegrationIntoSymSpace/JsonInterfaceReadMe.txt
===================================================================
--- /branches/3026_IntegrationIntoSymSpace/JsonInterfaceReadMe.txt (revision 17483)
+++ /branches/3026_IntegrationIntoSymSpace/JsonInterfaceReadMe.txt (revision 17483)
@@ -0,0 +1,38 @@
+Assemblies:
+ - HeuristicLab.JsonInterface
+ - HeuristicLab.JsonInterface.App (Application fÃŒr das AusfÃŒhren von Template-Konfig Kombinationen auf der Kommandozeile)
+ - HeuristicLab.JsonInterface.OptimizerIntegration (Importer/Exporter fÃŒr Templates aus dem Optimizer)
+
+eigenen Converter erstellen:
+ - IJsonItemConverter implementieren (oder von BaseConverter ableiten)
+ - "Priority", "ConvertableType" Eigenschaften und "Inject", "Extract" Methoden implementieren
+ - Converter werden zur Laufzeit gesucht (also egal in welchen Assembly der Converter existiert)
+ - es wird immer der Converter mit der höchsten PrioritÀt ausgewÀhlt ( = höchste Zahl)
+ - fÃŒr die Eigenschaft "ConvertableType" kann mit HEAL.Attic der Typ gefunden werden
+ - WICHTIG: immer den "Root"-Converter bei verschachtelte Converter-Aufrufe weiterreichen (verhindert Schleifen bei entsprechende Objektgraphen)
+
+
+eigenes JsonItem erstellen:
+ - IJsonItem implementieren (oder von einer abstrakten JsonItem-Klasse ableiten)
+ - fÃŒr De-/Serialisierung die Methoden "GenerateJObject" (Serialisierung) und "SetJObject" (Deserialisierung) ÃŒberschreiben
+ - fÃŒr die Validierung (ob z.B.: der Wert eines Items korrekt ist) die Methode "Validate" ÃŒberschreiben
+
+Ablauf:
+ 1. Suche nach Convertern (bei der Initialisierung)
+ 2. passender Converter wird fÌr ein IItem ausgewÀhlt
+ 3. IItem wird dem Converter ÃŒbergeben (Extract/Inject)
+ 4. bei Extract wird ein JsonItem-Baum zurÃŒckgegeben
+
+
+JCGenerator (Name nicht final):
+ - erzeugt Templates von einem "IOptimizer"-Objektes
+ - ACHTUNG: Templates bestehen immer aus zwei Files (.json, .hl)
+
+JsonTemplateInstantiator:
+ - erzeugt ein "IOptimizer"-Objekt aus einem Template (und gegebenfalls einer dazugehörigen konkreten Konfiguration)
+
+
+CLI Verwendung:
+ - HeuristicLab 3.3.exe /start:JsonInterface
+ - in Konfig können Parameter des Templates direkt eingefÌgt und verÀndert werden
+ - "Results" werden bei der Template Erzeugung erst erkannt wenn auch bereits Werte in "Results" enthalten sind