Changeset 6760 for branches/PersistenceSpeedUp/HeuristicLab.Optimization
- Timestamp:
- 09/14/11 13:59:25 (13 years ago)
- Location:
- branches/PersistenceSpeedUp
- Files:
-
- 14 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceSpeedUp
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/BatchRun.cs
r5445 r6760 41 41 public override Image ItemImage { 42 42 get { 43 if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary. ExecutablePrepared;44 else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary. ExecutableStarted;45 else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary. ExecutablePaused;46 else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary. ExecutableStopped;43 if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunPrepared; 44 else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunStarted; 45 else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunPaused; 46 else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunStopped; 47 47 else return HeuristicLab.Common.Resources.VSImageLibrary.Event; 48 48 } … … 220 220 if (clearRuns) runs.Clear(); 221 221 Optimizer.Prepare(clearRuns); 222 } else { 223 ExecutionState = ExecutionState.Stopped; 222 224 } 223 225 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/Experiment.cs
r5445 r6760 41 41 public override Image ItemImage { 42 42 get { 43 if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.Ex ecutablePrepared;44 else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.Ex ecutableStarted;45 else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.Ex ecutablePaused;46 else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary.Ex ecutableStopped;43 if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentPrepared; 44 else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentStarted; 45 else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentPaused; 46 else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentStopped; 47 47 else return HeuristicLab.Common.Resources.VSImageLibrary.Event; 48 48 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r6042 r6760 111 111 </ItemGroup> 112 112 <ItemGroup> 113 <Compile Include="RunCollectionDiscretizer.cs" /> 114 <Compile Include="RunCollectionGroupCreater.cs" /> 115 <Compile Include="RunCollectionSorter.cs" /> 116 <Compile Include="RunCollectionValueRemover.cs" /> 117 <Compile Include="IRunCollectionModifier.cs" /> 113 118 <None Include="HeuristicLabOptimizationPlugin.cs.frame" /> 114 119 <Compile Include="Algorithms\Algorithm.cs" /> 115 120 <Compile Include="BatchRun.cs" /> 121 <Compile Include="Calculator.cs" /> 116 122 <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" /> 117 123 <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" /> … … 136 142 <Compile Include="Interfaces\ISingleObjectiveHeuristicOptimizationProblem.cs" /> 137 143 <Compile Include="Problems\Problem.cs" /> 144 <Compile Include="RunCollectionFormulaModifer.cs" /> 138 145 <Compile Include="RunCollectionConstraints\RunCollectionComparisonConstraint.cs" /> 139 146 <Compile Include="RunCollectionConstraints\RunCollectionConstraintCollection.cs" /> 147 <Compile Include="RunCollectionConstraints\RunCollectionContentConstraint.cs" /> 140 148 <Compile Include="RunCollectionConstraints\RunCollectionTypeCompatiblityConstraint.cs" /> 141 149 <Compile Include="RunCollectionConstraints\RunCollectionEqualityConstraint.cs" /> … … 244 252 </BootstrapperPackage> 245 253 </ItemGroup> 254 <ItemGroup /> 246 255 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 247 256 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/HeuristicLabOptimizationPlugin.cs.frame
r6099 r6760 26 26 /// Plugin class for HeuristicLab.Optimization plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Optimization", "3.3. 4.$WCREV$")]28 [Plugin("HeuristicLab.Optimization", "3.3.5.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs
- Property svn:mergeinfo changed
-
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/Properties/AssemblyInfo.frame
r6099 r6760 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 4.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.5.$WCREV$")] -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/Result.cs
r5445 r6760 39 39 if (value != null) return value.ItemImage; 40 40 else return base.ItemImage; 41 } 42 } 43 44 public override string ItemDescription { 45 get { 46 if (Description != String.Empty) return Description; 47 else return base.ItemDescription; 41 48 } 42 49 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/ResultCollection.cs
r5445 r6760 40 40 return new ResultCollection(this, cloner); 41 41 } 42 43 public override System.Drawing.Image ItemImage { 44 get { return HeuristicLab.Common.Resources.VSImageLibrary.Object; } 45 } 42 46 } 43 47 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/RunCollection.cs
r5445 r6760 51 51 52 52 constraints = new RunCollectionConstraintCollection(original.constraints.Select(x => cloner.Clone(x))); 53 modifiers = new CheckedItemList<IRunCollectionModifier>(original.modifiers.Select(cloner.Clone)); 53 54 foreach (IRunCollectionConstraint constraint in constraints) 54 55 constraint.ConstrainedValue = this; … … 67 68 dataTypes = new Dictionary<string, HashSet<Type>>(); 68 69 constraints = new RunCollectionConstraintCollection(); 70 modifiers = new CheckedItemList<IRunCollectionModifier>(); 69 71 RegisterConstraintsEvents(); 70 72 } … … 83 85 get { return constraints; } 84 86 } 87 88 [Storable] 89 private CheckedItemList<IRunCollectionModifier> modifiers; 90 public CheckedItemList<IRunCollectionModifier> Modifiers { 91 get { return modifiers; } 92 } 93 85 94 86 95 private bool updateOfRunsInProgress; … … 98 107 private void AfterDeserialization() { 99 108 if (constraints == null) constraints = new RunCollectionConstraintCollection(); 109 if (modifiers == null) modifiers = new CheckedItemList<IRunCollectionModifier>(); 100 110 RegisterConstraintsEvents(); 101 111 RegisterConstraintEvents(constraints); … … 393 403 } 394 404 #endregion 405 406 #region Modification 407 public void Modify() { 408 UpdateOfRunsInProgress = true; 409 var runs = this.ToList(); 410 var selectedRuns = runs.Where(r => r.Visible).ToList(); 411 int nSelected = selectedRuns.Count; 412 if (nSelected > 0) { 413 foreach (var modifier in Modifiers.CheckedItems) 414 modifier.Value.Modify(selectedRuns); 415 if (nSelected != selectedRuns.Count || HaveDifferentOrder(selectedRuns, runs.Where(r => r.Visible))) { 416 Clear(); 417 AddRange(ReplaceVisibleRuns(runs, selectedRuns)); 418 } else if (runs.Count > 0) { 419 OnCollectionReset(this, runs); 420 } 421 } 422 UpdateOfRunsInProgress = false; 423 } 424 425 private static IEnumerable<IRun> ReplaceVisibleRuns(IEnumerable<IRun> runs, IEnumerable<IRun> visibleRuns) { 426 var newRuns = new List<IRun>(); 427 var runIt = runs.GetEnumerator(); 428 var visibleRunIt = visibleRuns.GetEnumerator(); 429 while (runIt.MoveNext()) { 430 if (runIt.Current != null && !runIt.Current.Visible) 431 newRuns.Add(runIt.Current); 432 else if (visibleRunIt.MoveNext()) 433 newRuns.Add(visibleRunIt.Current); 434 } 435 while (visibleRunIt.MoveNext()) 436 newRuns.Add(visibleRunIt.Current); 437 return newRuns; 438 } 439 440 private static bool HaveDifferentOrder(IEnumerable<IRun> l1, IEnumerable<IRun> l2) { 441 return l1.Zip(l2, (r1, r2) => r1 != r2).Any(); 442 } 443 #endregion 395 444 } 396 445 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/RunCollectionConstraints/IRunCollectionConstraint.cs
r5445 r6760 26 26 public interface IRunCollectionConstraint : IConstraint { 27 27 new RunCollection ConstrainedValue { get; set; } 28 } 29 30 public interface IRunCollectionColumnConstraint : IRunCollectionConstraint { 28 31 string ConstraintColumn { get; set; } 29 32 event EventHandler ConstraintColumnChanged; -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs
r5445 r6760 30 30 [StorableClass] 31 31 [Item("RunCollectionComparisonConstraint", "A constraint which compares the members of the contained runs with the constraint data.")] 32 public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionCo nstraint {32 public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionColumnConstraint { 33 33 [StorableConstructor] 34 34 protected RunCollectionComparisonConstraint(bool deserializing) : base(deserializing) { } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionEqualityConstraint.cs
r5445 r6760 30 30 [StorableClass] 31 31 [Item("RunCollectionEqualityConstraint", "A constraint which checks the members of the contained runs for equality to the constraint data.")] 32 public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionCo nstraint {32 public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionColumnConstraint { 33 33 [StorableConstructor] 34 34 protected RunCollectionEqualityConstraint(bool deserializing) : base(deserializing) { } … … 100 100 foreach (IRun run in ConstrainedValue.Where(r => r.Visible)) { 101 101 IItem item = ConstrainedValue.GetValue(run, constraintColumn); 102 if ( !base.Check(item.ToString()))102 if (item != null && !base.Check(item.ToString())) 103 103 run.Visible = false; 104 104 } -
branches/PersistenceSpeedUp/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs
r5445 r6760 30 30 [StorableClass] 31 31 [Item("RunCollectionTypeCompatibilityConstraint", "A constraint which checks the members of the contained runs for type compabitiliby to the constraint data.")] 32 public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionCo nstraint {32 public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionColumnConstraint { 33 33 [StorableConstructor] 34 34 protected RunCollectionTypeCompatibilityConstraint(bool deserializing) {
Note: See TracChangeset
for help on using the changeset viewer.