@Override 
	public ArrayList<Action> search (State sstart, State sgoal)
	{
		State father, current;
		State start=getState(sstart);
		State goal=getState(sgoal);		
		double tempGScore = 0;
		ArrayList<Action> legalActions;
		HashMap<State, StateActionPair> cameFrom = new HashMap<State, StateActionPair>() ;
		
		
		OpenSetAdd(start);
		start.setG(g.getDistance(start, start));
		start.setF(g.getDistance(start, start) + h.getDistance(start, goal));
		
		while (!IsEmptyOpenSet())
		{
			father=OpenSetPoll();
			if (father.equals(goal))
				return reconstructPath(cameFrom, father);
			ClosedSetAdd(father);
			legalActions=mDomain.getActions(father);
			for (Action a : legalActions)
			{
				current=getState(a.doAction(father));
				tempGScore=father.getG() + g.getDistance(father, current);
				
				if(ClosedSetContains(current) && tempGScore >= current.getG())
					continue;
				if ( !OpenSetContains(current) || tempGScore < current.getG() )
				{
					cameFrom.put(current, new StateActionPair(father,a));
					current.setG(tempGScore);
					current.setF(current.getG() + h.getDistance(current, goal));
					if (!OpenSetContains(current))
						OpenSetAdd(current);
				}
			}
				
		}
		
		return null;
		
	}