Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/17 09:28:34 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

Location:
branches/PushGP/HeuristicLab.PushGP/PushGP.Cli
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/PushGP.Cli/Program.cs

    r14834 r15017  
    33
    44namespace HeuristicLab.Algorithms.PushGP.Cli {
     5  using System.Collections.Generic;
     6  using System.Linq;
     7
    58  using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration;
     9  using HeuristicLab.Problems.ProgramSynthesis.Push.Constants;
    610  using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter;
    711
    812  class Program {
    913    static void Main(string[] args) {
    10       if (args.Length == 0) return;
     14      string code = null;
    1115
    12       var code = args[0];
     16      if (args.Length == 0) {
     17        var lines = new List<string>();
     18
     19        Console.WriteLine(@"Program: ( must start with '(' and end with ')' )");
     20
     21        var bracesCount = 0;
     22        var linesRead = 0;
     23
     24        while (bracesCount > 0 || lines.Count == 0 || linesRead == 0) {
     25          var line = Console.ReadLine();
     26          linesRead++;
     27
     28          if (string.IsNullOrWhiteSpace(line))
     29            continue;
     30
     31          line = line.Trim();
     32          lines.Add(line);
     33
     34          var openBraces = line.Count(c => c == PushEnvironment.ProgramStartSymbol);
     35          var closeBraces = line.Count(c => c == PushEnvironment.ProgramEndSymbol);
     36          bracesCount += openBraces - closeBraces;
     37        }
     38
     39        code = string.Join(" ", lines);
     40      } else {
     41        code = args[0];
     42      }
     43
    1344      EvaluateStepwise(code).Wait();
    1445
    15       Console.ReadKey();
     46      Console.WriteLine(@"Press any key to terminate...");
    1647    }
    1748
  • branches/PushGP/HeuristicLab.PushGP/PushGP.Cli/Push.Cli.csproj

    r14875 r15017  
    5050    <Reference Include="System" />
    5151    <Reference Include="System.Core" />
     52    <Reference Include="System.Windows.Forms" />
    5253    <Reference Include="System.Xml.Linq" />
    5354    <Reference Include="System.Data.DataSetExtensions" />
Note: See TracChangeset for help on using the changeset viewer.