Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
-Moved to slot 1. Now the NoFlyZoneGrapher will write to the folder currently not being used for the AStar search. However setting up of NoFlyZones for the AStar search can take up to 10 hours. Decrease the default interval value to reduce this time.
  • Loading branch information
Scratchcat1 authored Nov 3, 2017
1 parent 5c986f5 commit e44f9dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions AATC_NoFlyZoneGrapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self,Thread_Name,Thread_Queue,Interval = 36000):

graph = AATC_AStar.DynoGraph()
graph.ImportGraph()
self.xSize,self.ySize,self.zSize = graph.xSize,graph.ySize,graph.zSize
self.xSize,self.ySize,self.zSize = graph.Get_Size()
del graph

self.Main_Loop()
Expand All @@ -42,9 +42,11 @@ def Main_Loop(self):
Command,Arguments = data[0],data[1]
if Command == "Exit":
self.Exit = True

print("NoFlyZoneGrapher exiting...")

def Mod(self,Coords):
return int(Coords.x//self.xSize),int(Coords.y//self.ySize),int(Coords.z//self.zSize)
return int(Coords.Get_X()//self.xSize),int(Coords.Get_Y()//self.ySize),int(Coords.Get_Z()//self.zSize)

def GetNoFlyZones(self):
_,Columns,Data = self.DB.GetNoFlyZones()
Expand All @@ -69,7 +71,7 @@ def GetNoFlyZones(self):
return ProcessedData

def Make_Values(self,NoFlyZoneData):
graph = AATC_AStar.DynoGraph()
graph = AATC_AStar.DynoGraph(ABSlot = 1)
graph.ImportGraph()
Values = {}
for Zone in NoFlyZoneData:
Expand Down Expand Up @@ -98,10 +100,10 @@ def Make_Values(self,NoFlyZoneData):
for NodeID in list(Values.keys()):
node = graph.GetNode(NodeID)
if node.NodeID in Values:
node.Cost = Values[node.NodeID]
node.Set_Cost( Values[node.NodeID])
Values.pop(node.NodeID)# Reduce memory usage by evicting Node values which have been added already
else:
node.Cost = 1
node.Set_Cost(1)
try:
graph.SaveNodes()
except Exception as e:
Expand Down

0 comments on commit e44f9dc

Please sign in to comment.