Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNetworkItemCode.cs @ 11602

Last change on this file since 11602 was 11602, checked in by swagner, 10 years ago

#2205: Continued working on programmable network items

  • added VariableStore to all programmable network items
File size: 1.2 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3
4#region How to use the variable store?
5// use "Vars" to access variables in the variable store (e.g. Vars.x = 5)
6// use "Vars[string]" to access variables using runtime strings (e.g. Vars["x"] = 5)
7// use "Vars.Contains(string)" to check if a variable exists
8// use "Vars.Clear()" to remove all variables
9// use "foreach (KeyValuePair<string, object> v in Vars) { ... }" to iterate over all variables
10// use "Variables" to work with IEnumerable<T> extension methods on the variable store
11#endregion
12
13namespace HeuristicLab.Networks.Programmable {
14  [Item("MyProgrammableNetworkItem", "A programmable item of a network.")]
15  public class MyProgrammableNetworkItem : ProgrammableNetworkItem.CompiledProgrammableNetworkItem {
16    protected MyProgrammableNetworkItem(MyProgrammableNetworkItem original, Cloner cloner) : base(original, cloner) { }
17    public MyProgrammableNetworkItem(ProgrammableNetworkItem context) : base(context) { }
18
19    public override IDeepCloneable Clone(Cloner cloner) {
20      return new MyProgrammableNetworkItem(this, cloner);
21    }
22
23    public override void Initialize() {
24      base.Initialize();
25      // implement initialization here
26    }
27  }
28}
Note: See TracBrowser for help on using the repository browser.