priority optimization
This commit is contained in:
parent
2e79464483
commit
c5e626a772
@ -147,6 +147,9 @@ class Engine:
|
|||||||
|
|
||||||
goal_queue = PriorityQueue()
|
goal_queue = PriorityQueue()
|
||||||
|
|
||||||
|
# sorting objects by distance to waiter
|
||||||
|
self.objects.sort(key=lambda o: o.distance_to(self.user.obj.position))
|
||||||
|
|
||||||
for o in self.objects:
|
for o in self.objects:
|
||||||
|
|
||||||
condition = o.agent_role in [
|
condition = o.agent_role in [
|
||||||
|
@ -23,10 +23,13 @@ class Object:
|
|||||||
|
|
||||||
def get_angle(self):
|
def get_angle(self):
|
||||||
'''
|
'''
|
||||||
orientation = 0 -> up\n
|
orientation = 0 -> up
|
||||||
orientation = 1 -> left\n
|
|
||||||
orientation = 2 -> down\n
|
orientation = 1 -> left
|
||||||
orientation = 3 -> right\n
|
|
||||||
|
orientation = 2 -> down
|
||||||
|
|
||||||
|
orientation = 3 -> right
|
||||||
'''
|
'''
|
||||||
|
|
||||||
return self.orientation * 90
|
return self.orientation * 90
|
||||||
|
Loading…
Reference in New Issue
Block a user