Skip to content

Commit

Permalink
Added experimental generator of cfg files
Browse files Browse the repository at this point in the history
  • Loading branch information
MircoT committed May 31, 2014
1 parent faf452f commit 7171989
Show file tree
Hide file tree
Showing 4 changed files with 3,114 additions and 5 deletions.
12 changes: 7 additions & 5 deletions agents_dir/DijPlannerEvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def __init__(self):
super(DijPlannerEvo, self).__init__()
# dict of the last actions (reversed) for each goal
self.last_goals_moves = dict()
self.max_timer = 75
self.max_res = 5
self.max_timer = 100
self.max_res = 6
logging.basicConfig(level=logging.INFO,
filename='DijPlanner.log',
filemode='w',
# filename='DijPlanner.log',
# filemode='w',
format="%(levelname)s - Method(%(funcName)s) at line %(lineno)s: %(message)s")

@staticmethod
Expand Down Expand Up @@ -363,6 +363,7 @@ def solve(self, status, goal):
elif place in status.airports:
boxes_in_airports.append(TargetT(target, place))
elif target in status.airplanes:
logging.debug(target)
airplanes_in_airports.append(TargetT(target, place))

shuffle(boxes_in_airplanes)
Expand All @@ -378,7 +379,8 @@ def solve(self, status, goal):
cur_status, reached = self.resolve(
cur_status, goal, anction_list, target, t_place)
if reached:
self.last_goals_moves[anction_list[-1]] = (target, t_place)
if len(anction_list) != 0:
self.last_goals_moves[anction_list[-1]] = (target, t_place)
logging.debug("final status \n%s", cur_status)
logging.debug("tartget not reached %s",
[(target, t_place) for (target, t_place) in targetstuples if (target, t_place) not in self.last_goals_moves.values()])
Expand Down
Loading

0 comments on commit 7171989

Please sign in to comment.