Commit 15d37246 authored by Theodore Lopez's avatar Theodore Lopez
parents ac154d31 3485fa50
......@@ -40,8 +40,7 @@ public class AITile {
}
public boolean isObstacle(Map map){
//Map map=AbstractEntity.GetMap();
//Relayer relayer=AbstractEntity.GetRelay();
Tile tile=map.getTileAt(x/32,y/32);
TilePropertyVector tpv=tile.getTilePropertyVector();
List list= new ArrayList<TilePropertyVector.TileProperty>();
......@@ -91,7 +90,4 @@ public class AITile {
return Direction.NONE;
}
}
// others information could be here and be handled by Case Comparator if u want.
}
\ No newline at end of file
package artificial_intelligence.AlphaStar;
import artificial_intelligence.AlphaStar.AITile;
import java.util.Comparator;
......@@ -21,12 +20,11 @@ public class AITileComparator implements Comparator<AITile> {
* Allows to compare two tiles with respect to their distances to the obj tile.
* @param c1
* @param c2
* @return
* @return heuristic distance between both element
*/
@Override
public int compare(AITile c1, AITile c2)
{
// juste pour tester, mais il faudra changer car la conversion est trop violente
return heuristique(c1)- heuristique(c2);
}
......
......@@ -5,14 +5,14 @@ import java.util.Objects;
/**
* @author Yann RAMUSAT and Remy GARNIER
*
* Specific queue for the A* algorithm.
* Implement a queue for A* Algorithms
*/
public class AITileQueueElement implements Comparable<AITileQueueElement>{
private AITile caseElement;
private double value;
/**
* Enqueue.
* Add an eleement to the queue.
* @param element
* @param d
*/
......@@ -29,7 +29,7 @@ public class AITileQueueElement implements Comparable<AITileQueueElement>{
return caseElement;
}
@Override
public int compareTo(AITileQueueElement cqe)
{
return (value>cqe.value)?1:-1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment