- Timestamp:
- 06/12/13 13:05:24 (11 years ago)
- Location:
- branches/Robocode/HeuristicLab.Problems.Robocode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode/HeuristicLab.Problems.Robocode/Interpreter.cs
r9601 r9612 70 70 string cmdOutput = javaCompile.StandardOutput.ReadToEnd(); 71 71 cmdOutput += javaCompile.StandardError.ReadToEnd(); 72 72 73 //Evaluator.tankStatLog += cmdOutput; 73 74 //Console.WriteLine(cmdOutput); … … 79 80 80 81 javaCompile.WaitForExit(); 82 if (javaCompile.ExitCode != 0) { 83 return -1000.0; 84 } 81 85 #endregion 82 86 … … 101 105 evaluateCode.Start(); 102 106 103 // instead of p.WaitForExit(), do104 107 StringBuilder q = new StringBuilder(); 105 108 string scoreString = ""; 106 while (!evaluateCode.HasExited) { 109 evaluateCode.WaitForExit(); 110 111 try { 107 112 scoreString = evaluateCode.StandardOutput.ReadToEnd().Split( 108 113 new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Last(); 109 114 q.Append("Output: " + scoreString + "\r\n"); 110 115 q.Append("Error: " + evaluateCode.StandardError.ReadToEnd() + "\r\n"); 111 } 112 cmdOutput += q.ToString(); 116 cmdOutput += q.ToString(); 117 }catch { 118 return -1000.0; 119 } 113 120 114 121 #endregion -
branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/Event Methods/Events/EmptyEvent.cs
r9609 r9612 3 3 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 4 5 namespace HeuristicLab.Problems.Robocode 6 { 7 class EmptyEvent: CodeNode 8 { 9 public override int MinimumArity { get { return 0; } } 10 public override int MaximumArity { get { return 0; } } 5 namespace HeuristicLab.Problems.Robocode { 6 [StorableClass] 7 public class EmptyEvent : CodeNode { 8 public override int MinimumArity { get { return 0; } } 9 public override int MaximumArity { get { return 0; } } 11 10 12 13 11 [Storable] 12 public override string Prefix { get; set; } 14 13 15 16 14 [Storable] 15 public override string Suffix { get; set; } 17 16 18 [StorableConstructor] 19 private EmptyEvent(bool deserializing) : base(deserializing) { } 20 private EmptyEvent(EmptyEvent original, Cloner cloner) 21 : base(original, cloner) 22 { 23 this.Prefix = ""; 24 this.Suffix = ""; 25 } 17 [StorableConstructor] 18 private EmptyEvent(bool deserializing) : base(deserializing) { } 19 private EmptyEvent(EmptyEvent original, Cloner cloner) 20 : base(original, cloner) { 21 this.Prefix = ""; 22 this.Suffix = ""; 23 } 26 24 27 public EmptyEvent() 28 : base("EmptyEvent", "This is a placeholder for an empty event.") 29 { 30 this.Prefix = ""; 31 this.Suffix = ""; 32 } 25 public EmptyEvent() 26 : base("EmptyEvent", "This is a placeholder for an empty event.") { 27 this.Prefix = ""; 28 this.Suffix = ""; 29 } 33 30 34 public override IDeepCloneable Clone(Cloner cloner) 35 { 36 return new EmptyEvent(this, cloner); 37 } 31 public override IDeepCloneable Clone(Cloner cloner) { 32 return new EmptyEvent(this, cloner); 33 } 38 34 39 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) 40 { 41 return ""; 42 } 35 public override string Interpret(ISymbolicExpressionTreeNode node, System.Collections.Generic.IEnumerable<ISymbolicExpressionTreeNode> children) { 36 return ""; 43 37 } 38 } 44 39 }
Note: See TracChangeset
for help on using the changeset viewer.