Changeset 776 for trunk/sources/HeuristicLab.Core/Interfaces
- Timestamp:
- 11/19/08 12:12:39 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Core/Interfaces
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/Interfaces/IConstrainedItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent items that are subjects to restrictions. 29 /// </summary> 27 30 public interface IConstrainedItem : IItem { 31 /// <summary> 32 /// All constraints of the current instance. 33 /// </summary> 28 34 ICollection<IConstraint> Constraints { get; } 29 35 36 /// <summary> 37 /// Adds a constraint to the current instance. 38 /// </summary> 39 /// <param name="constraint">The constraint to add.</param> 30 40 void AddConstraint(IConstraint constraint); 41 /// <summary> 42 /// Removes a constraint from the current instance. 43 /// </summary> 44 /// <param name="constraint">The constraint to remove.</param> 31 45 void RemoveConstraint(IConstraint constraint); 32 46 47 /// <summary> 48 /// Checks whether the current instance fullfills all constraints. 49 /// </summary> 50 /// <returns><c>true</c> if all constraints are fullfilled, <c>false</c> otherwise.</returns> 33 51 bool IsValid(); 52 /// <summary> 53 /// Checks whether the current instance fullfills all constraints. 54 /// </summary> 55 /// <param name="violatedConstraints">Output parameter, all constraints that could not be fullfilled.</param> 56 /// <returns><c>true</c> if all constraints are fullfilled, <c>false</c> otherwise.</returns> 34 57 bool IsValid(out ICollection<IConstraint> violatedConstraints); 35 58 59 /// <summary> 60 /// An <see cref="EventHandler"/> for events when a new constraint is added. 61 /// </summary> 36 62 event EventHandler<ConstraintEventArgs> ConstraintAdded; 63 /// <summary> 64 /// An <see cref="EventHandler"/> for events when a constraint is deleted. 65 /// </summary> 37 66 event EventHandler<ConstraintEventArgs> ConstraintRemoved; 38 67 } -
trunk/sources/HeuristicLab.Core/Interfaces/IConstraint.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent restrictions. 29 /// </summary> 27 30 public interface IConstraint : IItem { 31 /// <summary> 32 /// Gets the description of the current instance. 33 /// </summary> 28 34 string Description { get; } 29 35 36 /// <summary> 37 /// Checks whether the given <paramref name="data"/> fulfills the current constraint. 38 /// </summary> 39 /// <param name="data">The item to check.</param> 40 /// <returns><c>true</c> if the current instance could be fulfilled, <c>false</c> otherwise.</returns> 30 41 bool Check(IItem data); 31 42 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEditable.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent editable items. 29 /// </summary> 27 30 public interface IEditable : IViewable { 31 /// <summary> 32 /// Creates an editor. 33 /// </summary> 34 /// <returns>The created editor as <see cref="IEditor"/>.</returns> 28 35 IEditor CreateEditor(); 29 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEditor.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an editor. 29 /// </summary> 27 30 public interface IEditor : IView { 31 32 /// <summary> 33 /// Gets or sets the filename. 34 /// </summary> 28 35 string Filename { get; set; } 29 36 37 /// <summary> 38 /// Occurs when the filename was changed. 39 /// </summary> 30 40 event EventHandler FilenameChanged; 31 41 } -
trunk/sources/HeuristicLab.Core/Interfaces/IEngine.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent one run. (An engine is an interpreter, holding the code, 29 /// the data and the actual state, which is the runtime stack and a pointer onto the next operation.). 30 /// It is responsible for operator execution and able to deal with parallelism. 31 /// </summary> 27 32 public interface IEngine : IItem { 33 /// <summary> 34 /// Gets the operator graph of the current instance. 35 /// </summary> 28 36 IOperatorGraph OperatorGraph { get; } 37 /// <summary> 38 /// Gets the global scope of the current instance. 39 /// </summary> 29 40 IScope GlobalScope { get; } 30 41 42 /// <summary> 43 /// Gets the execution time of the current instance. 44 /// </summary> 31 45 TimeSpan ExecutionTime { get; } 32 46 47 /// <summary> 48 /// Gets information whether the engine is currently running. 49 /// </summary> 33 50 bool Running { get; } 51 /// <summary> 52 /// Gets information whether the engine is canceled. 53 /// </summary> 34 54 bool Canceled { get; } 55 /// <summary> 56 /// Gets information whether the engine has already terminated. 57 /// </summary> 35 58 bool Terminated { get; } 36 59 60 /// <summary> 61 /// Executes the whole run. 62 /// </summary> 37 63 void Execute(); 64 /// <summary> 65 /// Executes one step (one operation). 66 /// </summary> 38 67 void ExecuteStep(); 68 /// <summary> 69 /// Executes the given number of steps. 70 /// </summary> 71 /// <param name="steps">The number of steps to execute.</param> 39 72 void ExecuteSteps(int steps); 73 /// <summary> 74 /// Aborts the engine run. 75 /// </summary> 40 76 void Abort(); 77 /// <summary> 78 /// Resets the current instance. 79 /// </summary> 41 80 void Reset(); 42 81 82 /// <summary> 83 /// Occurs when the current instance is initialized. 84 /// </summary> 43 85 event EventHandler Initialized; 86 /// <summary> 87 /// Occurs when an operation is executed. 88 /// </summary> 44 89 event EventHandler<OperationEventArgs> OperationExecuted; 90 /// <summary> 91 /// Occurs when an exception was thrown. 92 /// </summary> 45 93 event EventHandler<ExceptionEventArgs> ExceptionOccurred; 94 /// <summary> 95 /// Occurs when the execution time was changed. 96 /// </summary> 46 97 event EventHandler ExecutionTimeChanged; 98 /// <summary> 99 /// Occurs when the engine is finished. 100 /// </summary> 47 101 event EventHandler Finished; 48 102 } -
trunk/sources/HeuristicLab.Core/Interfaces/IItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent (almost) every HeuristicLab object (an object, an operator,...). 29 /// </summary> 27 30 public interface IItem : IStorable, IViewable { 31 /// <summary> 32 /// Fires a new <c>Changed</c> event. 33 /// </summary> 28 34 void FireChanged(); 29 35 36 /// <summary> 37 /// Occurs when the current instance has changed. 38 /// </summary> 30 39 event EventHandler Changed; 31 40 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperation.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an operation (Executes a defined number of operators on a defined scope). 29 /// </summary> 27 30 public interface IOperation : IItem { 28 31 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperator.cs
r47 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent an operator (e.g. GreaterThanComparator,...), 29 /// a basic instruction of an algorithm. 30 /// </summary> 27 31 public interface IOperator : IConstrainedItem { 32 /// <summary> 33 /// Gets or sets the name of the current instance. 34 /// </summary> 28 35 string Name { get; set; } 36 /// <summary> 37 /// Gets or sets the description of the current instance. 38 /// </summary> 29 39 string Description { get; } 30 40 41 /// <summary> 42 /// Gets information whether the current operator has been canceled. 43 /// </summary> 31 44 bool Canceled { get; } 45 /// <summary> 46 /// Gets or sets a boolean value whether the engine should stop here during the run. 47 /// </summary> 32 48 bool Breakpoint { get; set; } 33 49 50 /// <summary> 51 /// Gets a list of all sub operators. 52 /// </summary> 34 53 IList<IOperator> SubOperators { get; } 54 /// <summary> 55 /// Gets a collection of all variable (parameter) infos. 56 /// </summary> 35 57 ICollection<IVariableInfo> VariableInfos { get; } 58 /// <summary> 59 /// Gets a collection of all variables of the current operator. 60 /// </summary> 36 61 ICollection<IVariable> Variables { get; } 37 62 63 /// <summary> 64 /// Adds the given sub operator to the current instance. 65 /// </summary> 66 /// <param name="op">The operator to add.</param> 38 67 void AddSubOperator(IOperator op); 68 /// <summary> 69 /// Adds the given sub operator to the current instance if all constraints can be fulfilled. 70 /// </summary> 71 /// <param name="op">The operator to add.</param> 72 /// <returns><c>true</c> if the operator could be added without violating constraints, 73 /// <c>false</c> otherwise.</returns> 39 74 bool TryAddSubOperator(IOperator op); 75 /// <summary> 76 /// Adds the given sub operator to the current instance if all constraints can be fulfilled. 77 /// </summary> 78 /// <param name="op">The operator to add.</param> 79 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 80 /// fulfilled.</param> 81 /// <returns><c>true</c> if the operator could be added without violating constraints, 82 /// <c>false</c> otherwise.</returns> 40 83 bool TryAddSubOperator(IOperator op, out ICollection<IConstraint> violatedConstraints); 84 /// <summary> 85 /// Adds the given sub operator at a the specified <paramref name="index"/>. 86 /// </summary> 87 /// <param name="op">The operator to add.</param> 88 /// <param name="index">The position where to add the operator.</param> 41 89 void AddSubOperator(IOperator op, int index); 90 /// <summary> 91 /// Adds the given operator at the specified <paramref name="index"/> to the current instance 92 /// if all constraints can be fulfilled. 93 /// </summary> 94 /// <param name="op">The operator to add.</param> 95 /// <param name="index">The position where to add the operator.</param> 96 /// <returns><c>true</c> if the operator could be added without violating constraints, 97 /// <c>false</c> otherwise.</returns> 42 98 bool TryAddSubOperator(IOperator op, int index); 99 /// <summary> 100 /// Adds the given operator at the specified <paramref name="index"/> to the current instance 101 /// if all constraints can be fulfilled. 102 /// </summary> 103 /// <param name="op">The operator to add.</param> 104 /// <param name="index">The position where to add the operator.</param> 105 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 106 /// fulfilled.</param> 107 /// <returns><c>true</c> if the operator could be added without violating constraints, 108 /// <c>false</c> otherwise.</returns> 43 109 bool TryAddSubOperator(IOperator op, int index, out ICollection<IConstraint> violatedConstraints); 110 /// <summary> 111 /// Removes a sub operator at the specified <paramref name="index"/>. 112 /// </summary> 113 /// <param name="index">The position where to delete the operator.</param> 44 114 void RemoveSubOperator(int index); 115 /// <summary> 116 /// Removes a sub operator at the specified <paramref name="index"/> if all constraint can be fulfilled. 117 /// </summary> 118 /// <param name="index">The position where to delete the operator.</param> 119 /// <returns><c>true</c> if the operator could be deleted without violating constraints, 120 /// <c>false</c> otherwise.</returns> 45 121 bool TryRemoveSubOperator(int index); 122 /// <summary> 123 /// Deletes the operator at the specified <paramref name="index"/> 124 /// if all constraints can be fulfilled. 125 /// </summary> 126 /// <param name="index">The position where to delete the operator.</param> 127 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 128 /// fulfilled.</param> 129 /// <returns><c>true</c> if the operator could be deleted without violating constraints, 130 /// <c>false</c> otherwise.</returns> 46 131 bool TryRemoveSubOperator(int index, out ICollection<IConstraint> violatedConstraints); 47 132 133 /// <summary> 134 /// Gets the variable info with the given <paramref name="formalName"/>. 135 /// </summary> 136 /// <param name="formalName">The formal name of the variable info.</param> 137 /// <returns>The variable info with the specified formal name.</returns> 48 138 IVariableInfo GetVariableInfo(string formalName); 139 /// <summary> 140 /// Adds the specified variable info to the current instance. 141 /// </summary> 142 /// <param name="variableInfo">The variable info to add.</param> 49 143 void AddVariableInfo(IVariableInfo variableInfo); 144 /// <summary> 145 /// Adds the specified variable info to the current instance, if all constraints can be fulfilled. 146 /// </summary> 147 /// <param name="variableInfo">The variable info to add.</param> 148 /// <returns><c>true</c> if the variable info could be added without violating constraints, 149 /// <c>false</c> otherwise.</returns> 50 150 bool TryAddVariableInfo(IVariableInfo variableInfo); 151 /// <summary> 152 /// Adds the specified variable info to the current instance, if all constraints can be fulfilled. 153 /// </summary> 154 /// <param name="variableInfo">The variable info to add.</param> 155 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 156 /// fulfilled.</param> 157 /// <returns><c>true</c> if the variable info could be added without violating constraints, 158 /// <c>false</c> otherwise.</returns> 51 159 bool TryAddVariableInfo(IVariableInfo variableInfo, out ICollection<IConstraint> violatedConstraints); 160 /// <summary> 161 /// Removes the variable info with the given formal name. 162 /// </summary> 163 /// <param name="formalName">The formal name of the variable info to remove.</param> 52 164 void RemoveVariableInfo(string formalName); 165 /// <summary> 166 /// Deletes the variable info with the given formal name, 167 /// if all constraints can be fulfilled. 168 /// </summary> 169 /// <param name="formalName">The formal name of the variable info to remove.</param> 170 /// <returns><c>true</c> if the variable info could be deleted without violating constraints, 171 /// <c>false</c> otherwise.</returns> 53 172 bool TryRemoveVariableInfo(string formalName); 173 /// <summary> 174 /// Deletes the variable info with the given formal name, 175 /// if all constraints can be fulfilled. 176 /// </summary> 177 /// <param name="formalName">The formal name of the variable info to remove.</param> 178 /// <param name="violatedConstraints">Output parameter; contains all constraints that could not be 179 /// fulfilled.</param> 180 /// <returns><c>true</c> if the variable info could be deleted without violating constraints, 181 /// <c>false</c> otherwise.</returns> 54 182 bool TryRemoveVariableInfo(string formalName, out ICollection<IConstraint> violatedConstraints); 55 183 184 /// <summary> 185 /// Gets a variable with the given <paramref name="name"/>. 186 /// </summary> 187 /// <param name="name">The name of the variable.</param> 188 /// <returns>The variable with the specified name.</returns> 56 189 IVariable GetVariable(string name); 190 /// <summary> 191 /// Adds the specified <paramref name="variable"/> to the current instance. 192 /// </summary> 193 /// <param name="variable">The variable to add.</param> 57 194 void AddVariable(IVariable variable); 195 /// <summary> 196 /// Adds the specified <paramref name="variable"/> to the current instance if all constraints can 197 /// be fulfilled. 198 /// </summary> 199 /// <param name="variable">The variable to add.</param> 200 /// <returns><c>true</c> if the variable could be added without violating constraints, 201 /// <c>false</c> otherwise.</returns> 58 202 bool TryAddVariable(IVariable variable); 203 /// <summary> 204 /// Adds the specified <paramref name="variable"/> to the current instance if all constraints can 205 /// be fulfilled. 206 /// </summary> 207 /// <param name="variable">The variable to add.</param> 208 /// <param name="violatedConstraints">Output parameter; contains all constraints that could 209 /// not be fulfillled.</param> 210 /// <returns><c>true</c> if the variable could be added without violating constraints, 211 /// <c>false</c> otherwise.</returns> 59 212 bool TryAddVariable(IVariable variable, out ICollection<IConstraint> violatedConstraints); 213 /// <summary> 214 /// Deletes the variable with the specified <paramref name="name"/>. 215 /// </summary> 216 /// <param name="name">The name of the variable to delete.</param> 60 217 void RemoveVariable(string name); 218 /// <summary> 219 /// Deletes the variable with the specified <paramref name="name"/> if all constraints can be 220 /// fulfilled. 221 /// </summary> 222 /// <param name="name">The name of the variable to remove.</param> 223 /// <returns><c>true</c> if the variable could be deleted without violating constraints, 224 /// <c>false</c> otherwise.</returns> 61 225 bool TryRemoveVariable(string name); 226 /// <summary> 227 /// Deletes the variable with the specified <paramref name="name"/> if all constraints can be 228 /// fulfilled. 229 /// </summary> 230 /// <param name="name">The name of the variable to remove.</param> 231 /// <param name="violatedConstraints">Output parameter; contains all constraints that could 232 /// not be fulfilled.</param> 233 /// <returns><c>true</c> if the variable could be deleted without violating constraints, 234 /// <c>false</c> otherwise.</returns> 62 235 bool TryRemoveVariable(string name, out ICollection<IConstraint> violatedConstraints); 236 237 /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool)"/> 238 /// <typeparam name="T">The type of the value that is searched.</typeparam> 63 239 T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup) where T : class, IItem; 240 /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/> 241 /// <typeparam name="T">The type of the value that is searched.</typeparam> 64 242 T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup, bool throwOnError) where T : class, IItem; 243 /// <inheritdoc cref="GetVariableValue(System.String, IScope, bool, bool)" 244 /// select="summary"/> 245 /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param> 246 /// <param name="scope">The scope where to look for the variable.</param> 247 /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if 248 /// the variable is not found in the specified <paramref name="scope"/>.</param> 249 /// <returns>The value of the searched variable or null if it is not found.</returns> 65 250 IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup); 251 /// <summary> 252 /// Gets the value of the variable in the specified <paramref name="scope"/> 253 /// whose variable(parameter) info has the specified <paramref name="formalName"/>. 254 /// </summary> 255 /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param> 256 /// <param name="scope">The scope where to look for the variable.</param> 257 /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if 258 /// the variable is not found in the specified <paramref name="scope"/>.</param> 259 /// <param name="throwOnError">Boolean value, whether an exception shall be thrown, if the variable 260 /// cannot be found or just <c>null</c> shall be returned.</param> 261 /// <returns>The value of the searched variable (or null if the variable is not 262 /// found and <paramref name="throwOnError"/> is set to false).</returns> 66 263 IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup, bool throwOnError); 67 264 265 /// <summary> 266 /// Executes the current instance on the specified <paramref name="scope"/>. 267 /// </summary> 268 /// <param name="scope">The scope where to execute the current instance.</param> 269 /// <returns>The next operation.</returns> 68 270 IOperation Execute(IScope scope); 271 /// <summary> 272 /// Aborts the current operator. 273 /// </summary> 69 274 void Abort(); 70 275 276 /// <summary> 277 /// Occurs when the name of the operator was changed. 278 /// </summary> 71 279 event EventHandler NameChanged; 72 event EventHandler BreakpointChanged; 280 /// <summary> 281 /// Occurs when the breakpoint flag of the current instance was changed. 282 /// </summary> 283 event EventHandler BreakpointChanged; 284 /// <summary> 285 /// Occurs when a sub operator has been added. 286 /// </summary> 73 287 event EventHandler<OperatorIndexEventArgs> SubOperatorAdded; 288 /// <summary> 289 /// Occurs when a sub operator has been deleted. 290 /// </summary> 74 291 event EventHandler<OperatorIndexEventArgs> SubOperatorRemoved; 292 /// <summary> 293 /// Occurs when a variable info has been added. 294 /// </summary> 75 295 event EventHandler<VariableInfoEventArgs> VariableInfoAdded; 296 /// <summary> 297 /// Occurs when a variable info has been deleted. 298 /// </summary> 76 299 event EventHandler<VariableInfoEventArgs> VariableInfoRemoved; 300 /// <summary> 301 /// Occurs when a variable has been added. 302 /// </summary> 77 303 event EventHandler<VariableEventArgs> VariableAdded; 304 /// <summary> 305 /// Occurs when a variable has been deleted. 306 /// </summary> 78 307 event EventHandler<VariableEventArgs> VariableRemoved; 308 /// <summary> 309 /// Occurs when the current instance is executed. 310 /// </summary> 79 311 event EventHandler Executed; 80 312 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorGraph.cs
r47 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent an operator graph. 30 /// </summary> 28 31 public interface IOperatorGraph : IItem { 32 /// <summary> 33 /// Gets all operators of the current instance. 34 /// </summary> 29 35 ICollection<IOperator> Operators { get; } 36 /// <summary> 37 /// Gets or sets the initial operator (the starting one) of the current instance. 38 /// </summary> 30 39 IOperator InitialOperator { get; set; } 31 40 41 /// <summary> 42 /// Adds the given operator to the current instance. 43 /// </summary> 44 /// <param name="op">The operator to add.</param> 32 45 void AddOperator(IOperator op); 46 /// <summary> 47 /// Removes an operator with the specified <paramref name="guid"/> from the current instance. 48 /// </summary> 49 /// <param name="guid">The unique id of the operator to remove.</param> 33 50 void RemoveOperator(Guid guid); 51 /// <summary> 52 /// Gets the operator with the specified <paramref name="guid"/>. 53 /// </summary> 54 /// <param name="guid">The unique id of the operator.</param> 55 /// <returns>The searched operator.</returns> 34 56 IOperator GetOperator(Guid guid); 57 /// <summary> 58 /// Clears the current instance. 59 /// </summary> 35 60 void Clear(); 36 61 62 /// <summary> 63 /// Occurs when a new operator has been added to the current instance. 64 /// </summary> 37 65 event EventHandler<OperatorEventArgs> OperatorAdded; 66 /// <summary> 67 /// Occurs when an operator has been deleted from the current instance. 68 /// </summary> 38 69 event EventHandler<OperatorEventArgs> OperatorRemoved; 70 /// <summary> 71 /// Occurs when the initial operator (the starting one) has been changed. 72 /// </summary> 39 73 event EventHandler InitialOperatorChanged; 40 74 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorGroup.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a group of operators. 30 /// </summary> 28 31 public interface IOperatorGroup : IStorable { 32 /// <summary> 33 /// Gets or sets the name of the current instance. 34 /// </summary> 29 35 string Name { get; set; } 36 /// <summary> 37 /// Gets all sub groups of operators of the current instance. 38 /// </summary> 30 39 ICollection<IOperatorGroup> SubGroups { get; } 40 /// <summary> 41 /// Gets all operators of the current operator group. 42 /// </summary> 31 43 ICollection<IOperator> Operators { get; } 32 44 45 /// <summary> 46 /// Adds the specified sub group of operators to the current operator group. 47 /// </summary> 48 /// <param name="group">The operator group to add.</param> 33 49 void AddSubGroup(IOperatorGroup group); 50 /// <summary> 51 /// Deletes the specified sub group of operators from the current instance. 52 /// </summary> 53 /// <param name="group">The sub group to delete.</param> 34 54 void RemoveSubGroup(IOperatorGroup group); 55 /// <summary> 56 /// Adds the specified operator to the current instance. 57 /// </summary> 58 /// <param name="op">The operator to add.</param> 35 59 void AddOperator(IOperator op); 60 /// <summary> 61 /// Deletes the specified operator from the current instance. 62 /// </summary> 63 /// <param name="op">The operator to remove.</param> 36 64 void RemoveOperator(IOperator op); 37 65 66 /// <summary> 67 /// Occurs when the name of the operator group has been changed. 68 /// </summary> 38 69 event EventHandler NameChanged; 39 70 } -
trunk/sources/HeuristicLab.Core/Interfaces/IOperatorLibrary.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a library of operators. 30 /// </summary> 28 31 public interface IOperatorLibrary : IItem { 32 /// <summary> 33 /// Gets the operator group of the current instance. 34 /// </summary> 29 35 IOperatorGroup Group { get; } 30 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IRandom.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Represents an interface for random number generators. 30 /// </summary> 28 31 public interface IRandom : IItem { 32 /// <summary> 33 /// Resets the random number generator. 34 /// </summary> 29 35 void Reset(); 36 /// <summary> 37 /// Resets the random number generator with the given <paramref name="seed"/>. 38 /// </summary> 39 /// <param name="seed">The new seed.</param> 30 40 void Reset(int seed); 31 41 42 /// <summary> 43 /// Gets a new random number. 44 /// </summary> 45 /// <returns>A random integer number.</returns> 32 46 int Next(); 47 /// <summary> 48 /// Gets a new random number between 0 and <paramref name="maxVal"/>. 49 /// </summary> 50 /// <param name="maxVal">The maximal value of the random number.</param> 51 /// <returns>A random integer number smaller than or equal to <paramref name="maxVal"/>.</returns> 33 52 int Next(int maxVal); 53 /// <summary> 54 /// Gets a new random number between <paramref name="minVal"/> and <paramref name="maxVal"/>. 55 /// </summary> 56 /// <param name="maxVal">The maximal value of the random number.</param> 57 /// <param name="minVal">The minimal value of the random number.</param> 58 /// <returns>A random integer number. (<paramref name="minVal"/> <= x <= <paramref name="maxVal"/>.</returns> 34 59 int Next(int minVal, int maxVal); 60 /// <summary> 61 /// Gets a new double random number. 62 /// </summary> 63 /// <returns>A random double number.</returns> 35 64 double NextDouble(); 36 65 } -
trunk/sources/HeuristicLab.Core/Interfaces/IScope.cs
r63 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface for a hierarchical container of variables (containing variables and subscopes). 30 /// </summary> 28 31 public interface IScope : IItem { 32 /// <summary> 33 /// Gets the name of the current instance. 34 /// </summary> 29 35 string Name { get; } 30 36 37 /// <summary> 38 /// Gets the varibles of the current scope. 39 /// </summary> 31 40 ICollection<IVariable> Variables { get; } 41 /// <summary> 42 /// Gets all aliases of the current scope. 43 /// </summary> 32 44 IEnumerable<KeyValuePair<string, string>> Aliases { get; } 45 /// <summary> 46 /// Gets all subscopes in the current scope. 47 /// </summary> 33 48 IList<IScope> SubScopes { get; } 34 49 50 /// <summary> 51 /// Sets the parent scope for the current instance. 52 /// </summary> 53 /// <param name="scope">The parent scope of the current instance.</param> 35 54 void SetParent(IScope scope); 36 55 56 /// <summary> 57 /// Gets a variable with the given <paramref name="name"/>. 58 /// </summary> 59 /// <param name="name">The name of the variable.</param> 60 /// <returns>The variable with the specified name.</returns> 37 61 IVariable GetVariable(string name); 62 /// <summary> 63 /// Adds the specified variable to the curent instance. 64 /// </summary> 65 /// <param name="variable">The variable to add.</param> 38 66 void AddVariable(IVariable variable); 67 /// <summary> 68 /// Deletes a variable with the specified <paramref name="name"/> from the current instance. 69 /// </summary> 70 /// <param name="name">The name of the variable to delete.</param> 39 71 void RemoveVariable(string name); 72 73 /// <inheritdoc cref="GetVariableValue(string, bool)"/> 74 /// <typeparam name="T">The type of the value that is searched.</typeparam> 40 75 T GetVariableValue<T>(string name, bool recursiveLookup) where T : class, IItem; 76 /// <inheritdoc cref="GetVariableValue(string, bool, bool)"/> 77 /// <typeparam name="T">The type of the value that is searched.</typeparam> 41 78 T GetVariableValue<T>(string name, bool recursiveLookup, bool throwOnError) where T : class, IItem; 79 /// <inheritdoc cref="GetVariableValue(string, bool, bool)" select="summary"/> 80 /// <param name="name">The name of the variable.</param> 81 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 82 /// when the variable is not found in the current instance.</param> 83 /// <returns>The value of the variable or <c>null</c> if it was not found.</returns> 42 84 IItem GetVariableValue(string name, bool recursiveLookup); 85 /// <summary> 86 /// Gets the value of the variable with the given <paramref name="name"/>. 87 /// </summary> 88 /// <param name="name">The name of the variable.</param> 89 /// <param name="recursiveLookup">Boolean value, whether the parent scopes shall be searched 90 /// when the variable is not found in the current instance.</param> 91 /// <param name="throwOnError">Boolean value, whether an exception shall be thrown when the searched 92 /// variable cannot be found, or only <c>null</c> shall be returned.</param> 93 /// <returns>The value of the searched variable or <c>null</c> if <paramref name="throwOnError"/> 94 /// is set to <c>false</c>.</returns> 43 95 IItem GetVariableValue(string name, bool recursiveLookup, bool throwOnError); 44 96 97 /// <summary> 98 /// Gets the actual name the given alias. 99 /// </summary> 100 /// <param name="name">The alias whose actual name is searched.</param> 101 /// <returns>The actual name.</returns> 45 102 string TranslateName(string name); 103 /// <summary> 104 /// Adds an alias to the current instance. 105 /// </summary> 106 /// <param name="alias">The alias to add.</param> 107 /// <param name="name">The actual name of the alias.</param> 46 108 void AddAlias(string alias, string name); 109 /// <summary> 110 /// Deletes the specified <paramref name="alias"/> from the current instance. 111 /// </summary> 112 /// <param name="alias">The alias to delete.</param> 47 113 void RemoveAlias(string alias); 48 114 115 /// <summary> 116 /// Adds the specified sub scope to the current instance. 117 /// </summary> 118 /// <param name="scope">The sub scope to add.</param> 49 119 void AddSubScope(IScope scope); 120 /// <summary> 121 /// Deletes the specified sub scope from the current instance. 122 /// </summary> 123 /// <param name="scope">The sub scope to delete.</param> 50 124 void RemoveSubScope(IScope scope); 125 /// <summary> 126 /// Reorders all sub scopes according to the specified chronology. 127 /// </summary> 128 /// <param name="sequence">The chronology how to order the sub scopes.</param> 51 129 void ReorderSubScopes(int[] sequence); 130 /// <summary> 131 /// Gets the sub scope with the given <paramref name="guid"/>. 132 /// </summary> 133 /// <param name="guid">The unique identifier of the sub scope.</param> 134 /// <returns>The sub scope with the given <paramref name="guid"/>.</returns> 52 135 IScope GetScope(Guid guid); 136 /// <summary> 137 /// Gets the sub scope with the given <paramref name="name"/>. 138 /// </summary> 139 /// <param name="name">The name of the sub scope.</param> 140 /// <returns>The sub scope with the given <paramref name="name"/>.</returns> 53 141 IScope GetScope(string name); 54 142 143 /// <summary> 144 /// Clears the current instance. 145 /// </summary> 55 146 void Clear(); 56 147 148 /// <summary> 149 /// Occurs when a variable has been added to the current instance. 150 /// </summary> 57 151 event EventHandler<VariableEventArgs> VariableAdded; 152 /// <summary> 153 /// Occurs when a variable has been deleted from the current instance. 154 /// </summary> 58 155 event EventHandler<VariableEventArgs> VariableRemoved; 156 /// <summary> 157 /// Occurs when an alias has been added to the current instance. 158 /// </summary> 59 159 event EventHandler<AliasEventArgs> AliasAdded; 160 /// <summary> 161 /// Occurs when an alias has been removed from the current instance. 162 /// </summary> 60 163 event EventHandler<AliasEventArgs> AliasRemoved; 164 /// <summary> 165 /// Occurs when a sub scope has been added to the current instance. 166 /// </summary> 61 167 event EventHandler<ScopeIndexEventArgs> SubScopeAdded; 168 /// <summary> 169 /// Occurs when a sub scope has been deleted from the current instance. 170 /// </summary> 62 171 event EventHandler<ScopeIndexEventArgs> SubScopeRemoved; 172 /// <summary> 173 /// Occurs when the sub scopes have been reordered. 174 /// </summary> 63 175 event EventHandler SubScopesReordered; 64 176 } -
trunk/sources/HeuristicLab.Core/Interfaces/IStorable.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent objects that are de- and serializeable. 30 /// </summary> 28 31 public interface IStorable { 32 /// <summary> 33 /// Gets the objects unique identifier. 34 /// </summary> 29 35 Guid Guid { get; } 30 36 37 /// <summary> 38 /// Clones the current instance (deep clone). 39 /// </summary> 40 /// <returns>The cloned object.</returns> 31 41 object Clone(); 42 /// <summary> 43 /// Clones the current instance, considering already cloned objects. 44 /// </summary> 45 /// <param name="clonedObjects">All already cloned objects. (Needed to avoid cycles.)</param> 46 /// <returns>The cloned object.</returns> 32 47 object Clone(IDictionary<Guid, object> clonedObjects); 33 48 49 /// <summary> 50 /// Saves the current instance as <see cref="XmlNode"/> in the specified 51 /// <typeparamref name="document"/>. 52 /// </summary> 53 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 54 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 55 /// <param name="persistedObjects">The dictionary of all already persisted objects. 56 /// (Needed to avoid cycles.)</param> 57 /// <returns>The saved <see cref="XmlNode"/>.</returns> 34 58 XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects); 59 /// <summary> 60 /// Loads the persisted object from the specified <paramref name="node"/>. 61 /// </summary> 62 /// <param name="node">The <see cref="XmlNode"/> where the object is saved.</param> 63 /// <param name="restoredObjects">A dictionary of all already restored objects. (Needed to avoid 64 /// cycles.)</param> 35 65 void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects); 36 66 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVariable.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to represent a variable (of an operator) having a name and a value. 30 /// </summary> 28 31 public interface IVariable : IItem { 32 /// <summary> 33 /// Gets or sets the name of the variable. 34 /// </summary> 29 35 string Name { get; set; } 36 /// <summary> 37 /// Gets or sets the value of the variable. 38 /// </summary> 30 39 IItem Value { get; set; } 31 40 41 /// <summary> 42 /// Gets the value of the variable. 43 /// </summary> 44 /// <typeparam name="T">The type of the variable's value.</typeparam> 45 /// <returns>The value of the current instance.</returns> 32 46 T GetValue<T>() where T : class, IItem; 33 47 48 /// <summary> 49 /// Occurs when the name of the variable is currently changing. 50 /// </summary> 34 51 event EventHandler<NameChangingEventArgs> NameChanging; 52 /// <summary> 53 /// Occurs when the name of the current instance has been changed. 54 /// </summary> 35 55 event EventHandler NameChanged; 56 /// <summary> 57 /// Occurs when the value of the current instance has been changed. 58 /// </summary> 36 59 event EventHandler ValueChanged; 37 60 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVariableInfo.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// Interface to store meta-information about variables/parameters of operators. 30 /// </summary> 28 31 public interface IVariableInfo : IItem { 32 /// <summary> 33 /// Gets or sets the actual name of the variable info. 34 /// </summary> 29 35 string ActualName { get; set; } 36 /// <summary> 37 /// Gets or sets the formal name of the current instance. 38 /// </summary> 30 39 string FormalName { get; } 40 /// <summary> 41 /// Gets the description of the current instance. 42 /// </summary> 31 43 string Description { get; } 44 /// <summary> 45 /// Gets the data type of the current instance. 46 /// </summary> 32 47 Type DataType { get; } 48 /// <summary> 49 /// Gets the kind of the variable info (in, out, new,...). 50 /// </summary> 33 51 VariableKind Kind { get; } 52 /// <summary> 53 /// Gets or sets a boolean value whether the current instance is a local variable info. 54 /// </summary> 34 55 bool Local { get; set; } 35 56 57 /// <summary> 58 /// Occurs when the actual name of the current instance has been changed. 59 /// </summary> 36 60 event EventHandler ActualNameChanged; 61 /// <summary> 62 /// Occurs when the local flag has been changed. 63 /// </summary> 37 64 event EventHandler LocalChanged; 38 65 } -
trunk/sources/HeuristicLab.Core/Interfaces/IView.cs
r2 r776 26 26 27 27 namespace HeuristicLab.Core { 28 /// <summary> 29 /// An interface for all kinds visual representations of items (objects, operators...). 30 /// </summary> 28 31 public interface IView : IControl { 32 /// <summary> 33 /// Gets the current item instance. 34 /// </summary> 29 35 IItem Item { get; } 36 /// <summary> 37 /// Gets or sets the caption of the current instance. 38 /// </summary> 30 39 string Caption { get; set; } 31 40 41 /// <summary> 42 /// Occurs when the item was changed. 43 /// </summary> 32 44 event EventHandler ItemChanged; 45 /// <summary> 46 /// Occurs when the caption was changed. 47 /// </summary> 33 48 event EventHandler CaptionChanged; 34 49 } -
trunk/sources/HeuristicLab.Core/Interfaces/IViewable.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Interface to represent items that can displayed visually. 29 /// </summary> 27 30 public interface IViewable { 31 /// <summary> 32 /// Creates a view to display the current instance. 33 /// </summary> 34 /// <returns>The created view.</returns> 28 35 IView CreateView(); 29 36 } -
trunk/sources/HeuristicLab.Core/Interfaces/IVisualizationItem.cs
r2 r776 25 25 26 26 namespace HeuristicLab.Core { 27 /// <summary> 28 /// Marker interface for items that can be visualized. 29 /// </summary> 27 30 public interface IVisualizationItem : IItem { } 28 31 }
Note: See TracChangeset
for help on using the changeset viewer.