/// <summary> /// /// </summary> /// <param name="ee"></param> private void InsertEdgeEnds(IEnumerable <EdgeEnd> ee) { foreach (EdgeEnd e in ee) { _nodes.Add(e); } }
private void BuildParentEntityNodes() { NodeMap.Add("ContractType", new EngineNodeHolder(EngineNode: null, EngineNodeOptions.CallbackValue, "Lease")); NodeMap.Add("LegalEntity.Name", new EngineNodeHolder(EngineNode: "_Customer")); NodeMap.Add("Customer.Party.PartyName", new EngineNodeHolder(EngineNode: "_ShipContact", EngineNodeOptions.LinePosition, "2")); NodeMap.Add("Vendor.Party.PartyName", new EngineNodeHolder(EngineNode: "_CompanyName1")); NodeMap.Add("InvoiceNumber", new EngineNodeHolder(EngineNode: "_DocumentRef")); NodeMap.Add("Alias", new EngineNodeHolder(EngineNode: "_CallRef")); NodeMap.Add("InvoiceDate", new EngineNodeHolder(EngineNode: "_Date", EngineNodeOptions.Date)); NodeMap.Add("DueDate", new EngineNodeHolder(EngineNode: "_Date", EngineNodeOptions.Date)); NodeMap.Add("Currency.Name", new EngineNodeHolder(EngineNode: null, EngineNodeOptions.CallbackValue, "ZAR")); NodeMap.Add("ContractCurrency.Name", new EngineNodeHolder(EngineNode: null, EngineNodeOptions.CallbackValue, "ZAR")); NodeMap.Add("InvoiceTotal", new EngineNodeHolder(EngineNode: "_Total", EngineNodeOptions.NodePosition, "10")); NodeMap.Add("NumberOfAssets", new EngineNodeHolder(EngineNode: "_LineItems", EngineNodeOptions.NodeCount)); NodeMap.Add("AllowCreateAssets", new EngineNodeHolder(EngineNode: null, EngineNodeOptions.CallbackValue, "true")); }
/// <summary> /// /// </summary> /// <param name="ee"></param> public void InsertEdgeEnds(IList <EdgeEnd> ee) { foreach (var e in ee) { _nodes.Add(e); } }
/// <summary> /// /// </summary> /// <param name="ee"></param> public virtual void InsertEdgeEnds(IList ee) { for (IEnumerator i = ee.GetEnumerator(); i.MoveNext();) { EdgeEnd e = (EdgeEnd)i.Current; _nodes.Add(e); } }
} // public IntersectionMatrix ComputeIM() #endregion #region Private Methods /// <summary> /// /// </summary> /// <param name="ee"></param> private void InsertEdgeEnds(ArrayList ee) { foreach (object obj in ee) { EdgeEnd e = (EdgeEnd)obj; _nodes.Add(e); } } // private void InsertEdgeEnds( ArrayList ee )
} // public void CopyNodesAndLabels( GeometryGraph geomGraph, int argIndex ) /// <summary> /// /// </summary> /// <param name="ee"></param> public void InsertEdgeEnds(ArrayList ee) { foreach (object obj in ee) { EdgeEnd e = (EdgeEnd)obj; _nodes.Add(e); } // foreach ( object obj in ee ) } // public void InsertEdgeEnds( ArrayList ee)
/// <summary> /// /// </summary> /// <param name="ee"></param> private void InsertEdgeEnds(IList ee) { for (IEnumerator i = ee.GetEnumerator(); i.MoveNext();) { EdgeEnd e = (EdgeEnd)i.Current; nodes.Add(e); } }
public void SyncUI() { NodeMap.Clear(); SceneTree.Nodes[0].Nodes.Clear(); NodeMap.Add(SceneTree.Nodes[0], EditGraph.Root); SyncNode(SceneTree.Nodes[0], EditGraph.Root); Invalidate(); }
/// <summary> /// Constructor when reading subcircuit instances /// </summary> /// <param name="parent">Parent</param> /// <param name="subckt">Subcircuit definition</param> public SubcircuitPath(Netlist netlist, SubcircuitPath parent, Subcircuit subckt) { // Same global parameters globalparameters = parent.globalparameters; // Same globals Globals = parent.Globals; // Build parameters Parameters = GenerateParameters(netlist, subckt.Definition, subckt.Parameters); // Build instance path if (parent.InstancePath != null) { InstancePath = parent.InstancePath.Grow(subckt.Name.Name); } else { InstancePath = subckt.Name; } // Build the definition path if (parent.DefinitionPath != null) { DefinitionPath = parent.DefinitionPath.Grow(subckt.Definition.Name.Name); } else { DefinitionPath = subckt.Definition.Name; } // Node map NodeMap = GenerateNodeMap(subckt.Definition, subckt.Pins); // Add globals to the nodemap foreach (var id in Globals) { if (!NodeMap.ContainsKey(id)) { NodeMap.Add(id, id); } } // Check for recursively called paths if (parent.DefinitionPath != null) { for (int i = 0; i < parent.DefinitionPath.Path.Length; i++) { if (parent.DefinitionPath.Path[i] == subckt.Definition.Name.Name) { throw new ParseException($"Subcircuit definition {subckt.Definition} is called recursively"); } } } }
private void BuildChildEntityNodes() { NodeMap.Add("PayableInvoiceAssets.Asset.Alias", new EngineNodeHolder(EngineNode: "_ItemCode", EngineNodeOptions.EngineNode, IsParentAttribute: false)); NodeMap.Add("Asset.Alias", new EngineNodeHolder(EngineNode: "_ItemCode", EngineNodeOptions.EngineNode, IsParentAttribute: false)); NodeMap.Add("Asset.Description", new EngineNodeHolder(EngineNode: "_ItemDescription", EngineNodeOptions.EngineNode, IsParentAttribute: false)); NodeMap.Add("Asset.Quantity", new EngineNodeHolder(EngineNode: "_Quantity", EngineNodeOptions.EngineNode, IsParentAttribute: false)); }
private void SyncNode(TreeNode node, GraphNode gnode) { node.Name = gnode.Name; foreach (var gn in gnode.Nodes) { TreeNode nn = new TreeNode(gn.Name); node.Nodes.Add(nn); NodeMap.Add(nn, gn); SyncNode(nn, gn); } }
string FormatNodeIfNew(ViterbiNode node) { var nodeId = GetNodeId(node); if (!NodeMap.ContainsKey(nodeId)) { NodeMap.Add(node.GetHashCode().ToString(), node); return(FormatNode(node)); } else { return(""); } }
private void InstantiateNodes() { var i = 0; foreach (var node in _gameBoard.Nodes) { var nodeView = _itemPool.GetNode(); // Set the node's parent as this puzzle nodeView.transform.SetParent(transform); nodeView.Init(node, _gameBoard.StartIsland.Contains(node), levelCompleted, i); nodeView.name = "Node " + i++; NodeMap.Add(node.Position, nodeView); } }
private void CineGraphNewSprite(object sender, EventArgs e) { EditNode = new GraphNode(); TreeNode nt = new TreeNode(); nt.Text = "New Sprite"; GraphNode nn = new GraphNode(); nn.Name = "New Sprite"; NodeMap.Add(nt, nn); SceneTree.Nodes[0].Nodes.Add(nt); EditGraph.Add(nn); PropGrid.SelectedObject = nn; }
protected void AddRelContained() { foreach (IfcRelContainedInSpatialStructure scRel in _model.Instances.OfType <IfcRelContainedInSpatialStructure>()) { if (scRel.RelatingStructure != null) { CompositionNode treeItem; if (!NodeMap.TryGetValue(scRel.RelatingStructure, out treeItem)) //already written { treeItem = new CompositionNode(scRel.RelatingStructure); NodeMap.Add(scRel.RelatingStructure, treeItem); } AddRelatedElements(scRel, treeItem); } } }
protected void AddRelatedObjects(IfcRelDecomposes rel, CompositionNode treeItem) { foreach (IfcObjectDefinition child in rel.RelatedObjects) { if (child.EntityLabel == treeItem.EntityId) { continue; } //prevent any infinite looping CompositionNode childItem; if (!NodeMap.TryGetValue(child, out childItem)) //already written { childItem = new CompositionNode(child); NodeMap.Add(child, childItem); } treeItem.Children.Add(childItem); } }
protected void AddRelatedElements(IfcRelContainedInSpatialStructure scRel, CompositionNode treeItem) { var applicableTypes = scRel.RelatedElements .Where(t => !t.GetType().IsSubclassOf(typeof(IfcFeatureElementSubtraction))); foreach (IfcObjectDefinition child in applicableTypes) { CompositionNode childItem; if (!NodeMap.TryGetValue(child, out childItem)) //already written { childItem = new CompositionNode(child); NodeMap.Add(child, childItem); } //Node family = GetFamily(treeItem, child); // TODO: Add child to family, not treeItem treeItem.Children.Add(childItem); } }
protected void AddRelComposes() { foreach (IfcRelDecomposes rel in _model.Instances.OfType <IfcRelDecomposes>()) { if (rel.RelatingObject != null) { // Get the subject of the decomposition from the relationship var parentRel = rel.RelatingObject; if (parentRel == null) { continue; } //var parent = parentRel.RelatingObject; CompositionNode treeItem; if (!NodeMap.TryGetValue(parentRel, out treeItem)) { treeItem = new CompositionNode(parentRel); NodeMap.Add(parentRel, treeItem); } AddRelatedObjects(rel, treeItem); } } }
public MapServices() { #region MapDefinition map.Add("Oradea", new List <string>() { "Zerind", "Sibiu" }); map.Add("Zerind", new List <string>() { "Oradea", "Arad" }); map.Add("Arad", new List <string>() { "Timisoara", "Zerind", "Sibiu" }); map.Add("Timisoara", new List <string>() { "Arad", "Lugoj" }); map.Add("Lugoj", new List <string>() { "Timisoara", "Mehadia" }); map.Add("Mehadia", new List <string>() { "Lugoj", "Drobeta" }); map.Add("Drobeta", new List <string>() { "Mehadia", "Craiova" }); map.Add("Craiova", new List <string>() { "Drobeta", "Rimnicu Vilcea", "Pitesti" }); map.Add("Rimnicu Vilcea", new List <string>() { "Sibiu", "Pitesti", "Craiova" }); map.Add("Sibiu", new List <string>() { "Arad", "Oradea", "Rimnicu Vilcea", "Fagaras" }); map.Add("Pitesti", new List <string>() { "Rimnicu Vilcea", "Craiova", "Bucharest" }); map.Add("Fagaras", new List <string>() { "Sibiu", "Bucharest" }); map.Add("Bucharest", new List <string>() { "Pitesti", "Giurgiu", "Urziceni", "Fagaras" }); map.Add("Giurgiu", new List <string>() { "Bucharest" }); map.Add("Urziceni", new List <string>() { "Bucharest", "Hirsova", "Vaslui" }); map.Add("Hirsova", new List <string>() { "Eforie", "Urziceni" }); map.Add("Eforie", new List <string>() { "Hirsova" }); map.Add("Vaslui", new List <string>() { "Urziceni", "Iasi" }); map.Add("Iasi", new List <string>() { "Vaslui", "Neamt" }); map.Add("Neamt", new List <string>() { "Iasi" }); #endregion #region DistanceMapDefinition distanceMap.Add ("Oradea", new Dictionary <string, double>() { { "Zerind", 71 }, { "Sibiu", 151 } } ); distanceMap.Add ("Zerind", new Dictionary <string, double>() { { "Oradea", 71 }, { "Arad", 75 } } ); distanceMap.Add ("Arad", new Dictionary <string, double>() { { "Timisoara", 118 }, { "Zerind", 75 }, { "Sibiu", 140 } } ); distanceMap.Add ("Timisoara", new Dictionary <string, double>() { { "Arad", 118 }, { "Lugoj", 111 } } ); distanceMap.Add ("Lugoj", new Dictionary <string, double>() { { "Timisoara", 111 }, { "Mehadia", 70 } } ); distanceMap.Add ("Mehadia", new Dictionary <string, double>() { { "Lugoj", 70 }, { "Drobeta", 75 } } ); distanceMap.Add ("Drobeta", new Dictionary <string, double>() { { "Mehadia", 75 }, { "Craiova", 120 } } ); distanceMap.Add ("Craiova", new Dictionary <string, double>() { { "Drobeta", 120 }, { "Rimnicu Vilcea", 146 }, { "Pitesti", 138 } } ); distanceMap.Add ("Rimnicu Vilcea", new Dictionary <string, double>() { { "Craiova", 146 }, { "Sibiu", 80 }, { "Pitesti", 97 } } ); distanceMap.Add ("Sibiu", new Dictionary <string, double>() { { "Oradea", 151 }, { "Rimnicu Vilcea", 80 }, { "Fagaras", 99 }, { "Arad", 140 } } ); distanceMap.Add ("Pitesti", new Dictionary <string, double>() { { "Rimnicu Vilcea", 97 }, { "Craiova", 138 }, { "Bucharest", 101 } } ); distanceMap.Add ("Fagaras", new Dictionary <string, double>() { { "Sibiu", 99 }, { "Bucharest", 211 } } ); distanceMap.Add ("Bucharest", new Dictionary <string, double>() { { "Pitesti", 101 }, { "Fagaras", 211 }, { "Giurgiu", 90 }, { "Urziceni", 85 } } ); distanceMap.Add ("Giurgiu", new Dictionary <string, double>() { { "Bucharest", 90 } } ); distanceMap.Add ("Urziceni", new Dictionary <string, double>() { { "Bucharest", 90 }, { "Hirsova", 98 }, { "Vaslui", 142 } } ); distanceMap.Add ("Hirsova", new Dictionary <string, double>() { { "Urziceni", 98 }, { "Eforie", 86 } } ); distanceMap.Add ("Eforie", new Dictionary <string, double>() { { "Hirsova", 86 } } ); distanceMap.Add ("Vaslui", new Dictionary <string, double>() { { "Urziceni", 142 }, { "Iasi", 92 } } ); distanceMap.Add ("Iasi", new Dictionary <string, double>() { { "Vaslui", 92 }, { "Neamt", 87 } } ); distanceMap.Add ("Neamt", new Dictionary <string, double>() { { "Iasi", 87 } } ); #endregion #region NodeMapDefinition Node Oradea = new Node("Oradea", null, null); Node Zerind = new Node("Zerind", null, null); Node Arad = new Node("Arad", null, null); Node Timisoara = new Node("Timisoara", null, null); Node Lugoj = new Node("Lugoj", null, null); Node Mehadia = new Node("Mehadia", null, null); Node Drobeta = new Node("Drobeta", null, null); Node Craiova = new Node("Craiova", null, null); Node Rimnicu_Vilcea = new Node("Rimnicu Vilcea", null, null); Node Sibiu = new Node("Sibiu", null, null); Node Pitesti = new Node("Pitesti", null, null); Node Fagaras = new Node("Fagaras", null, null); Node Bucharest = new Node("Bucharest", null, null); Node Giurgiu = new Node("Giurgiu", null, null); Node Urziceni = new Node("Urziceni", null, null); Node Hirsova = new Node("Hirsova", null, null); Node Eforie = new Node("Eforie", null, null); Node Vaslui = new Node("Vaslui", null, null); Node Iasi = new Node("Iasi", null, null); Node Neamt = new Node("Neamt", null, null); Oradea.Neighbours = new Dictionary <Node, double>() { { Zerind, 71 }, { Sibiu, 151 } }; Zerind.Neighbours = new Dictionary <Node, double>() { { Oradea, 71 }, { Arad, 75 } }; Arad.Neighbours = new Dictionary <Node, double>() { { Zerind, 75 }, { Sibiu, 140 }, { Timisoara, 118 } }; Timisoara.Neighbours = new Dictionary <Node, double>() { { Arad, 118 }, { Lugoj, 111 } }; Lugoj.Neighbours = new Dictionary <Node, double>() { { Timisoara, 111 }, { Mehadia, 70 } }; Mehadia.Neighbours = new Dictionary <Node, double>() { { Lugoj, 70 }, { Drobeta, 75 } }; Drobeta.Neighbours = new Dictionary <Node, double>() { { Mehadia, 75 }, { Craiova, 120 } }; Craiova.Neighbours = new Dictionary <Node, double>() { { Drobeta, 120 }, { Pitesti, 138 }, { Rimnicu_Vilcea, 146 } }; Rimnicu_Vilcea.Neighbours = new Dictionary <Node, double>() { { Craiova, 146 }, { Sibiu, 80 }, { Pitesti, 97 } }; Sibiu.Neighbours = new Dictionary <Node, double>() { { Arad, 140 }, { Oradea, 151 }, { Rimnicu_Vilcea, 80 }, { Fagaras, 99 } }; Pitesti.Neighbours = new Dictionary <Node, double>() { { Rimnicu_Vilcea, 97 }, { Craiova, 138 }, { Bucharest, 101 } }; Fagaras.Neighbours = new Dictionary <Node, double>() { { Sibiu, 99 }, { Bucharest, 211 } }; Bucharest.Neighbours = new Dictionary <Node, double>() { { Pitesti, 101 }, { Fagaras, 211 }, { Giurgiu, 90 }, { Urziceni, 85 } }; Giurgiu.Neighbours = new Dictionary <Node, double>() { { Bucharest, 90 } }; Urziceni.Neighbours = new Dictionary <Node, double>() { { Bucharest, 85 }, { Hirsova, 98 }, { Vaslui, 142 } }; Hirsova.Neighbours = new Dictionary <Node, double>() { { Urziceni, 98 }, { Eforie, 86 } }; Eforie.Neighbours = new Dictionary <Node, double>() { { Hirsova, 86 } }; Vaslui.Neighbours = new Dictionary <Node, double>() { { Urziceni, 142 }, { Iasi, 92 } }; Iasi.Neighbours = new Dictionary <Node, double>() { { Vaslui, 92 }, { Neamt, 87 } }; Neamt.Neighbours = new Dictionary <Node, double>() { { Iasi, 87 } }; NodeMap.Add(Oradea); NodeMap.Add(Zerind); NodeMap.Add(Arad); NodeMap.Add(Timisoara); NodeMap.Add(Lugoj); NodeMap.Add(Mehadia); NodeMap.Add(Drobeta); NodeMap.Add(Craiova); NodeMap.Add(Rimnicu_Vilcea); NodeMap.Add(Sibiu); NodeMap.Add(Pitesti); NodeMap.Add(Fagaras); NodeMap.Add(Bucharest); NodeMap.Add(Giurgiu); NodeMap.Add(Urziceni); NodeMap.Add(Hirsova); NodeMap.Add(Eforie); NodeMap.Add(Vaslui); NodeMap.Add(Iasi); NodeMap.Add(Neamt); #endregion #region AStarNodeMapDefinition AddAStarNodes(); #endregion }