예제 #1
0
 public INodeBoolMap SetBoolValues(INetworkAdjList network, int index, object defaultVal)
 {
     INodeBoolMap map = network.CreateNodeMap(LayerDataType._bool, string.Format("bool_{0}", index), defaultVal) as INodeBoolMap;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = Convert.ToBoolean(_Rand.Next(2));
     }
     return map;
 }
예제 #2
0
 public INodeDoubleMap SetDoubleValues(INetworkAdjList network, int index)
 {
     INodeDoubleMap map = network.CreateNodeMap(LayerDataType._double, string.Format("dubs_{0}", index), 0.0) as INodeDoubleMap;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = _Rand.NextDouble();
     }
     return map;
 }
예제 #3
0
 public INodeBoolMap SetBoolValues(INetworkAdjList network, int index, bool[] vals)
 {
     INodeBoolMap map = network.CreateNodeMap(LayerDataType._bool, string.Format("bool_{0}", index), false) as INodeBoolMap;
     int ctr = 0;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = vals[ctr++];
     }
     return map;
 }
예제 #4
0
 public INodeStringMap SetStringValues(INetworkAdjList network, int index, object defaultVal)
 {
     INodeStringMap map = network.CreateNodeMap(LayerDataType._string, string.Format("str_{0}", index), defaultVal) as INodeStringMap;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = string.Format("{0}-XYZ", _Rand.Next(network.NodeCount));
     }
     return map;
 }
예제 #5
0
 public INodeIntMap SetIntValues(INetworkAdjList network, int index, int[] vals)
 {
     INodeIntMap map = network.CreateNodeMap(LayerDataType._integer, string.Format("ints_{0}", index), 0) as INodeIntMap;
     int ctr = 0;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = vals[ctr++];
     }
     return map;
 }
예제 #6
0
 public INodeIntMap SetIntValues(INetworkAdjList network, int index, object defaultVal)
 {
     INodeIntMap map = network.CreateNodeMap(LayerDataType._integer, string.Format("ints_{0}", index), defaultVal) as INodeIntMap;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = _Rand.Next(network.NodeCount);
     }
     return map;
 }
예제 #7
0
 public INodeDoubleMap SetDoubleValues(INetworkAdjList network, int index, double[] vals)
 {
     INodeDoubleMap map = network.CreateNodeMap(LayerDataType._double, string.Format("dubs_{0}", index), 0.0) as INodeDoubleMap;
     int ctr = 0;
     foreach (INode node in network.NodeEnumerator)
     {
         map[node] = vals[ctr++];
     }
     return map;
 }