Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2924_DotNetCoreMigration/HeuristicLab.DynamicAssemblyTestApp/InspectApplication.cs @ 16985

Last change on this file since 16985 was 16985, checked in by dpiringe, 6 years ago

#2924:

  • added CLI Framework HeuristicLab.CommandLineInterface
  • added definition language test project HeuristicLab.DefinitionLanguage
  • added test project HeuristicLab.DynamicAssemblyTestApp, for PluginInfrastructure testing
  • changed project HeuristicLab to .NET Core and used it to create a CLI-Tool with the new CLI Framework
  • added Docker support to HeuristicLab
  • added IRunnerHost.cs ... forgot last commit
  • changed DockerRunnerHost and NativeRunnerHost to HeuristicLab-3.3.exe, was a little test project before
  • added new solution file HeuristicLab 3.3 No Views.sln, where all view projects are unloaded at start
File size: 1.2 KB
Line 
1using System;
2using HeuristicLab.Common;
3using HeuristicLab.Core;
4using HeuristicLab.Optimization;
5using HeuristicLab.PluginInfrastructure;
6
7namespace HeuristicLab.DynamicAssemblyTestApp {
8  [Serializable]
9  public class InspectApplication : ApplicationBase {
10    public UniPath InputFilePath { get; set; }
11    public override void Run(ICommandLineArgument[] args) {
12      ContentManager.Initialize(new PersistenceContentManager());
13      IStorableContent content = ContentManager.Load(InputFilePath.ToString());
14      IOptimizer optimizer = content as IOptimizer;
15      if (content != null) {
16        Console.WriteLine($"Name: {optimizer.Name}");
17        Console.WriteLine($"Description: {optimizer.Description}");
18        Console.WriteLine($"Run count: {optimizer.Runs.Count}");
19        Console.WriteLine("\nRESULT(S):");
20        int i = 1;
21        foreach (var run in optimizer.Runs) {
22          Console.WriteLine($"{"-------------------------------- RUN",35} {$"{i++:D3}" + " --------------------------------",-35}");
23          foreach (var res in run.Results) {
24            Console.WriteLine($"{res.Key,35} : {res.Value,-35}");
25          }
26        }
27      }
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.