add basic core structure and first parts of antGame implementation
This commit is contained in:
parent
66ee33b77f
commit
431ae4d3df
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="true" />
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -13,4 +13,6 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
compileOnly 'org.projectlombok:lombok:1.18.10'
|
||||||
|
annotationProcessor 'org.projectlombok:lombok:1.18.10'
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package evironment.antGame;
|
||||||
|
|
||||||
|
import core.DiscreteAction;
|
||||||
|
import core.Observation;
|
||||||
|
import core.RNG;
|
||||||
|
import core.StepResult;
|
||||||
|
|
||||||
|
public class AntWorld {
|
||||||
|
private Grid grid;
|
||||||
|
|
||||||
|
public AntWorld(int width, int height, double foodDensity){
|
||||||
|
grid = new Grid(width, height, foodDensity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AntWorld(){
|
||||||
|
this(30, 30, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StepResult step(DiscreteAction<AntAction> action){
|
||||||
|
Observation observation = new AntObservation();
|
||||||
|
return new StepResult(observation, 0.0, false, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset(){
|
||||||
|
RNG.reseed();
|
||||||
|
grid.initCells();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue