heuristic.adaptToGoal(locs[1], map);
Agent agent = null;
MapAgentFrame.SelectionState state = frame.getSelection();
switch (state.getValue(MapAgentFrame.AGENT_SEL)) {
case 0:
agent = new MapAgent(map, env, search, new String[] { locs[1] });
break;
case 1:
Problem p = new BidirectionalMapProblem(map, null, locs[1]);
OnlineSearchProblem osp = new OnlineSearchProblem
(p.getActionsFunction(), p.getGoalTest(), p.getStepCostFunction());