Changeset 18045 for branches/3026_IntegrationIntoSymSpace
- Timestamp:
- 08/31/21 15:43:06 (3 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.App/Runner.cs
r18041 r18045 12 12 internal static class Runner { 13 13 internal static void Run(string template, string config, string outputFile) { 14 try { 15 InstantiatorResult instantiatorResult = JsonTemplateInstantiator.Instantiate(template, config); 16 IOptimizer optimizer = instantiatorResult.Optimizer; 17 IEnumerable<IResultJsonItem> configuredResultItem = instantiatorResult.ConfiguredResultItems; 14 InstantiatorResult instantiatorResult = JsonTemplateInstantiator.Instantiate(template, config); 15 IOptimizer optimizer = instantiatorResult.Optimizer; 16 IEnumerable<IResultJsonItem> configuredResultItem = instantiatorResult.ConfiguredResultItems; 18 17 19 20 21 18 optimizer.Runs.Clear(); 19 if (optimizer is EngineAlgorithm e) 20 e.Engine = new ParallelEngine.ParallelEngine(); 22 21 23 24 25 26 27 22 Task task = optimizer.StartAsync(); 23 while (!task.IsCompleted) { 24 WriteResultsToFile(outputFile, optimizer, configuredResultItem); 25 Thread.Sleep(100); 26 } 28 27 29 WriteResultsToFile(outputFile, optimizer, configuredResultItem); 30 } catch (Exception e) { 31 Console.Error.WriteLine($"{e.Message} \n\n\n\n {e.StackTrace}"); 32 File.WriteAllText(outputFile, e.Message + "\n\n\n\n" + e.StackTrace); 33 Environment.Exit(-1); 34 } 28 WriteResultsToFile(outputFile, optimizer, configuredResultItem); 35 29 } 36 30 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs
r18043 r18045 11 11 12 12 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { 13 IParameterizedItempItem = item as IParameterizedItem;13 var pItem = item as IParameterizedItem; 14 14 15 15 if(data.Children != null) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r18044 r18045 43 43 StringArrayJsonItem allowedInputVariables = null; 44 44 45 46 45 // search first for the items (cache them, because the 47 46 // order is important for injection) 48 47 foreach (var child in data.Children) { 49 50 48 if (child.Path.EndsWith(Dataset)) 51 49 dataset = child as DoubleMatrixJsonItem; … … 58 56 else if (child.Path.EndsWith(AllowedInputVariables)) 59 57 allowedInputVariables = child as StringArrayJsonItem; 60 61 58 } 62 59 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs
r18043 r18045 20 20 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { 21 21 IValueLookupParameter param = value as IValueLookupParameter; 22 23 22 IValueLookupJsonItem item = new ValueLookupJsonItem(); 24 23 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs
r18043 r18045 13 13 IParameter parameter = value as IParameter; 14 14 15 if (!(data is EmptyJsonItem)) { 16 if (parameter.ActualValue == null) 17 parameter.ActualValue = Instantiate(parameter.DataType); 18 root.Inject(parameter.ActualValue, data, root); 19 } 15 if (parameter.ActualValue == null) 16 parameter.ActualValue = Instantiate(parameter.DataType); 17 root.Inject(parameter.ActualValue, data, root); 20 18 } 21 19 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.PluginInfrastructure/3.3/Main.cs
r18040 r18045 56 56 57 57 public static void HeadlessRun(string[] args) { 58 string pluginPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); 59 var pluginManager = new PluginManager(pluginPath); 60 pluginManager.DiscoverAndCheckPlugins(); 58 try { 59 string pluginPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); 60 var pluginManager = new PluginManager(pluginPath); 61 pluginManager.DiscoverAndCheckPlugins(); 61 62 62 var arguments = CommandLineArgumentHandling.GetArguments(args); 63 foreach (var argument in arguments) { 64 if (argument is StartArgument) { 65 var arg = (StartArgument)argument; 66 var appDesc = (from desc in pluginManager.Applications 67 where desc.Name.Equals(arg.Value) 68 select desc).SingleOrDefault(); 69 if (appDesc != null) { 70 try { 63 var arguments = CommandLineArgumentHandling.GetArguments(args); 64 foreach (var argument in arguments) { 65 if (argument is StartArgument) { 66 var arg = (StartArgument)argument; 67 var appDesc = (from desc in pluginManager.Applications 68 where desc.Name.Equals(arg.Value) 69 select desc).SingleOrDefault(); 70 if (appDesc != null) { 71 71 pluginManager.Run(appDesc, arguments); 72 } catch (Exception e) {73 Console.WriteLine(e.Message);74 72 } 75 73 } 76 74 } 75 } catch (Exception e) { 76 Console.Error.WriteLine($"{e.Message} \n\n {e.StackTrace}"); 77 Environment.Exit(-1); 77 78 } 78 79 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab/3.3/HeuristicLab-3.3.csproj
r16565 r18045 23 23 <OldToolsVersion>3.5</OldToolsVersion> 24 24 <UpgradeBackupLocation /> 25 <IsWebBootstrapper>false</IsWebBootstrapper> 26 <TargetFrameworkProfile> 27 </TargetFrameworkProfile> 25 28 <PublishUrl>publish\</PublishUrl> 26 29 <Install>true</Install> … … 35 38 <ApplicationRevision>0</ApplicationRevision> 36 39 <ApplicationVersion>1.0.0.%2a</ApplicationVersion> 37 <IsWebBootstrapper>false</IsWebBootstrapper>38 40 <UseApplicationTrust>false</UseApplicationTrust> 39 41 <BootstrapperEnabled>true</BootstrapperEnabled> 40 <TargetFrameworkProfile>41 </TargetFrameworkProfile>42 42 </PropertyGroup> 43 43 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Note: See TracChangeset
for help on using the changeset viewer.