private void ApplyAllTags(ref ModelNode[] all_nodes, ref Adjacency[] all_edges, ref List <int[]> node_relevants, ref Tag[] tags) { //Apply node properties for (int i = 0; i < all_nodes.Length; i++) { ModelNode current_node = all_nodes[i]; int[] relevants = node_relevants[i]; for (int k = 0; k < relevants.Length; k++) { int tagindex = relevants[k]; Tag current_tag = tags[tagindex]; current_tag.ApplyAsApplicable(ref current_node); } } //apply edge properties for (int i = 0; i < all_edges.Length; i++) { Adjacency current_edge = all_edges[i]; int[] relevants_a = node_relevants[current_edge.RootIndex]; int[] relevants_b = node_relevants[current_edge.EndIndex]; for (int k = 0; k < relevants_a.Length; k++) { int tagindex = relevants_a[k]; Tag current_tag = tags[tagindex]; current_tag.ApplyAsApplicable(ref current_edge); } for (int k = 0; k < relevants_b.Length; k++) { int tagindex = relevants_b[k]; Tag current_tag = tags[tagindex]; current_tag.ApplyAsApplicable(ref current_edge); } } }
public void ApplyAsApplicable(ref Adjacency edge) { for (int i = 0; i < edge_parameter_names.Count; i++) { SetProperty(edge, edge_parameter_names[i], edge_parameter_values[i]); } }
public void AddAdjacency(Adjacency a) { adjacencies.Add(a); }