Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
15d37246
Commit
15d37246
authored
Jan 06, 2016
by
Theodore Lopez
Browse files
Merge branch 'master' of
https://gitlab.crans.org/genie_logiciel_2015/the_dungeon_project
parents
ac154d31
3485fa50
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/artificial_intelligence/AlphaStar/AITile.java
View file @
15d37246
...
...
@@ -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
src/artificial_intelligence/AlphaStar/AITileComparator.java
View file @
15d37246
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
);
}
...
...
src/artificial_intelligence/AlphaStar/AITileQueueElement.java
View file @
15d37246
...
...
@@ -5,14 +5,14 @@ import java.util.Objects;
/**
* @author Yann RAMUSAT and Remy GARNIER
*
*
Specific
queue for
the
A*
a
lgorithm
.
*
Implement a
queue for A*
A
lgorithm
s
*/
public
class
AITileQueueElement
implements
Comparable
<
AITileQueueElement
>{
private
AITile
caseElement
;
private
double
value
;
/**
*
En
queue.
*
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment