public List < AState > search()
	{
		if(!this.calculated)
		{
			this.stateOpened = 0;
			
			List < AState > opened = new LinkedList < AState >();
			AState current = this.map.getStartState();
			
			long start = System.currentTimeMillis();
			
			while(!current.isGoal())
			{
				current.setClosed(true);
				List < AState > neighbors = this.map.getAllNeighbors(current);
				for(AState state : neighbors)
				{
					double cost = this.map.getCost(current, state);
					if(state.getG() <= current.getG() + cost)
						continue;
					
					state.setG(current.getG() + cost);
					state.setFather(current);
					state.setClosed(false);
					
					this.insertInOpened(opened, state);
				}
				
				if(opened.isEmpty()) break;
				
				current = opened.get(0);
				opened.remove(current);
				this.stateOpened++;
				
				if(System.currentTimeMillis() - start > 10000)
					break;
			}
			
			if(current.isGoal())
			{
				this.resolved = true;
				
				this.road.add(current);
				while(!current.equals(this.map.getStartState()))
				{
					current = current.getFather();
					this.road.add(0, current);
				}
			}
			
			this.calculated = true;
		}
		
		return this.road;
	}