Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/30/14 23:25:21 (9 years ago)
Author:
swagner
Message:

#2205: Continued working on programmable network items

  • added VariableStore to all programmable network items
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Networks/3.3/Programmable/ProgrammableNodeCode.cs

    r11577 r11602  
    44using System;
    55using System.Threading;
     6
     7#region How to use the variable store?
     8// use "Vars" to access variables in the variable store (e.g. Vars.x = 5)
     9// use "Vars[string]" to access variables using runtime strings (e.g. Vars["x"] = 5)
     10// use "Vars.Contains(string)" to check if a variable exists
     11// use "Vars.Clear()" to remove all variables
     12// use "foreach (KeyValuePair<string, object> v in Vars) { ... }" to iterate over all variables
     13// use "Variables" to work with IEnumerable<T> extension methods on the variable store
     14#endregion
    615
    716namespace HeuristicLab.Networks.Programmable {
     
    1524    }
    1625
    17     protected override void MessagePort_MessageReceived(object sender, EventArgs<IMessage, CancellationToken> e) {
     26    public override void Initialize() {
     27      base.Initialize();
     28      // implement initialization here
     29    }
     30
     31    protected override void ProcessMessage(IMessage message, IMessagePort port, CancellationToken token) {
    1832      // implement processing of messages here
    1933    }
Note: See TracChangeset for help on using the changeset viewer.