Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/12/14 03:02:37 (10 years ago)
Author:
swagner
Message:

#2205: Worked on optimization networks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/InputPort.cs

    r11438 r11452  
    4444          RegisterOutputPortEvents();
    4545          OnOutputPortChanged();
     46          UpdateValue();
    4647        }
    4748      }
     
    7980    }
    8081
     82    protected virtual void UpdateValue() {
     83      if (OutputPort != null) {
     84        var value = OutputPort.Value;
     85        if (value != null)
     86          value = (T)value.Clone();
     87        Value = value;
     88        //DISCUSS: clone value?
     89        //DISCUSS: switch threads to decouple value propagation and to make communication asynchronous -> should be done in Node?
     90      }
     91    }
     92
    8193    public event EventHandler OutputPortChanged;
    8294    protected void OnOutputPortChanged() {
     
    96108    }
    97109    protected void OutputPort_ValueChanged(object sender, EventArgs e) {
    98       var value = OutputPort.Value;
    99       if (value != null)
    100         value = (T)value.Clone();
    101       Value = value;
    102       //DISCUSS: clone value?
    103       //DISCUSS: switch threads to decouple value propagation and to make communication asynchronous -> should be done in Node?
     110      UpdateValue();
    104111    }
    105112  }
Note: See TracChangeset for help on using the changeset viewer.