public TrialState(Node n, TrialState.TrialFinishedCallback cb) { _node = n; _callback = cb; ArrayList con_list = new ArrayList(); foreach (Connection con in _node.ConnectionTable.GetConnections(ConnectionType.Structured)) { if (con.Edge is Tunnel.TunnelEdge) { continue; } con_list.Add(con); } if (con_list.Count == 0) { throw new Exception("Cannot initialize a trial state (No usable structured connections)."); } Connection target = (Connection)con_list[_rand.Next(con_list.Count)]; _target_address = target.Address; _target_edge = target.Edge; _state_result = new WriteOnce <Hashtable>(); _num_samples = 0; _started = 0; }
public TrialState(Node n, TrialState.TrialFinishedCallback cb) { _node = n; _callback = cb; ArrayList con_list = new ArrayList(); foreach (Connection con in _node.ConnectionTable.GetConnections(ConnectionType.Structured)) { if (con.Edge is Tunnel.TunnelEdge) { continue; } con_list.Add(con); } if (con_list.Count == 0) { throw new Exception("Cannot initialize a trial state (No usable structured connections)."); } Connection target = (Connection) con_list[_rand.Next(con_list.Count)]; _target_address = target.Address; _target_edge = target.Edge; _state_result = new WriteOnce<Hashtable>(); _num_samples = 0; _started = 0; }