private void CreateEntranceEdges(Entrance entrance, AbsType type) { var level = entrance.GetEntranceLevel(_clusterSize, _maxLevel); var srcAbstractNodeId = _hierarchicalMap.ConcreteNodeIdToAbstractNodeIdMap[entrance.SrcNode.NodeId]; var destAbstractNodeId = _hierarchicalMap.ConcreteNodeIdToAbstractNodeIdMap[entrance.DestNode.NodeId]; var orientation = entrance.Orientation; int cost = Constants.COST_ONE; switch (type) { case AbsType.ABSTRACT_TILE: case AbsType.ABSTRACT_OCTILE_UNICOST: // Inter-edges: cost 1 cost = Constants.COST_ONE; break; case AbsType.ABSTRACT_OCTILE: { int unitCost; switch (orientation) { case Orientation.Horizontal: case Orientation.Vertical: unitCost = Constants.COST_ONE; break; case Orientation.Hdiag2: case Orientation.Hdiag1: case Orientation.Vdiag1: case Orientation.Vdiag2: unitCost = (Constants.COST_ONE * 34) / 24; break; default: unitCost = -1; break; } cost = unitCost; } break; } _hierarchicalMap.AbstractGraph.AddEdge(srcAbstractNodeId, destAbstractNodeId, new AbstractEdgeInfo(cost, level, true)); _hierarchicalMap.AbstractGraph.AddEdge(destAbstractNodeId, srcAbstractNodeId, new AbstractEdgeInfo(cost, level, true)); }
public void SetType(TileType tileType) { switch (tileType) { case TileType.Tile: Type = AbsType.ABSTRACT_TILE; break; case TileType.Octile: Type = AbsType.ABSTRACT_OCTILE; break; case TileType.OctileUnicost: Type = AbsType.ABSTRACT_OCTILE_UNICOST; break; } }
//检查字典 public ActionResult ExaminationItem() { List <AbsType> examinationitem = new List <AbsType>(); DataSet info = _ServicesSoapClient.GetExaminationItem(); foreach (DataRow row in info.Tables[0].Rows) { AbsType absinfo = new AbsType(); absinfo.Type = row[0].ToString(); absinfo.Code = row[1].ToString(); absinfo.TypeName = row[2].ToString(); absinfo.Name = row[3].ToString(); absinfo.InputCode = row[4].ToString(); absinfo.SortNo = Convert.ToInt32(row[5]); examinationitem.Add(absinfo); } return(View(examinationitem)); }
//体征字典 public ActionResult VitalSigns() { List <AbsType> vitalsigns = new List <AbsType>(); DataSet info = _ServicesSoapClient.GetVitalSigns(); foreach (DataRow row in info.Tables[0].Rows) { AbsType absinfo = new AbsType(); absinfo.Type = row[0].ToString(); absinfo.Code = row[1].ToString(); absinfo.TypeName = row[2].ToString(); absinfo.Name = row[3].ToString(); absinfo.InputCode = row[4].ToString(); absinfo.SortNo = Convert.ToInt32(row[5]); vitalsigns.Add(absinfo); } return(View(vitalsigns)); }
private void CreateEntranceEdges(Entrance entrance, AbsType type, Dictionary<int, AbsTilingNodeInfo> absNodes) { int level; switch (entrance.Orientation) { case Orientation.HORIZONTAL: level = DetermineLevel(entrance.Coord1.Y); break; case Orientation.VERTICAL: level = DetermineLevel(entrance.Coord1.X); break; default: level = -1; break; } var abstractNodeId1 = absNodes[entrance.Coord1Id].Id; var abstractNodeId2 = absNodes[entrance.Coord2Id].Id; switch (type) { case AbsType.ABSTRACT_TILE: case AbsType.ABSTRACT_OCTILE_UNICOST: // Inter-edges: cost 1 var absTilingEdgeInfo1 = new AbsTilingEdgeInfo(Constants.COST_ONE, level, true); var absTilingEdgeInfo2 = new AbsTilingEdgeInfo(Constants.COST_ONE, level, true); HierarchicalMap.AbstractGraph.AddEdge(abstractNodeId1, abstractNodeId2, absTilingEdgeInfo1); HierarchicalMap.AbstractGraph.AddEdge(abstractNodeId2, abstractNodeId1, absTilingEdgeInfo2); break; case AbsType.ABSTRACT_OCTILE: { int unitCost; switch (entrance.Orientation) { case Orientation.HORIZONTAL: case Orientation.VERTICAL: unitCost = Constants.COST_ONE; break; case Orientation.HDIAG2: case Orientation.HDIAG1: case Orientation.VDIAG1: case Orientation.VDIAG2: unitCost = (Constants.COST_ONE * 34) / 24; break; default: unitCost = -1; break; } var absTilingEdgeInfo3 = new AbsTilingEdgeInfo(unitCost, level, true); var absTilingEdgeInfo4 = new AbsTilingEdgeInfo(unitCost, level, true); HierarchicalMap.AbstractGraph.AddEdge(abstractNodeId1, abstractNodeId2, absTilingEdgeInfo3); HierarchicalMap.AbstractGraph.AddEdge(abstractNodeId2, abstractNodeId1, absTilingEdgeInfo4); } break; default: break; } }
public void SetType(TileType tileType) { switch(tileType) { case TileType.TILE: Type = AbsType.ABSTRACT_TILE; break; case TileType.OCTILE: Type = AbsType.ABSTRACT_OCTILE; break; case TileType.OCTILE_UNICOST: Type = AbsType.ABSTRACT_OCTILE_UNICOST; break; } }