Commit c6be28d8 authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

runtime fixes

1 merge request!1Add Svn history
Showing with 21 additions and 16 deletions
+21 -16
......@@ -2,11 +2,7 @@
<!DOCTYPE xml>
<pikelake.Grid>
<torusType>BOTH</torusType>
<neighborsType>NEIGHBORHOOD_VON_NEUMANN</neighborsType>
<preyCarryingCapacity>50</preyCarryingCapacity>
<gridWidth>10</gridWidth>
<gridHeight>10</gridHeight>
<habitatValue0>0.25</habitatValue0>
<habitatValue1>0.5</habitatValue1>
<habitatValue2>1</habitatValue2>
<neighborsType>NEIGHBORHOOD_VON_NEUMANN</neighborsType>
<gridWidth>10</gridWidth>
<gridHeight>10</gridHeight>
</pikelake.Grid>
\ No newline at end of file
......@@ -5,6 +5,8 @@ import fr.cemagref.simaqualife.extensions.spatial2D.Grid2D.NeighborsType;
import fr.cemagref.simaqualife.kernel.AquaNismsGroup;
import fr.cemagref.simaqualife.kernel.util.TransientParameters.InitTransientParameters;
import fr.cemagref.simaqualife.pilot.Pilot;
import java.util.ArrayList;
import java.util.List;
import pikelake.pikes.Pike;
public class Grid extends Grid2D<Cell, Individual> {
......@@ -16,8 +18,9 @@ public class Grid extends Grid2D<Cell, Individual> {
@InitTransientParameters
public void initTransientParameters(Pilot pilot) {
// TODO
// TODO empty grid
this.grid = new Cell[]{new Cell(0, 0.0), new Cell(1, 0.0)};
}
@Override
......@@ -39,4 +42,10 @@ public class Grid extends Grid2D<Cell, Individual> {
ind.getPosition().removePike((Pike) ind);
}
public List<Cell> getNeighbours(Cell position, int distance) {
// TODO
return new ArrayList<Cell>();
}
}
......@@ -13,22 +13,22 @@ import fr.cemagref.simaqualife.pilot.Pilot;
public class PikeMovement extends LoopAquaNismsGroupProcess<Pike, PikesGroup> {
private int distance;
transient private UniformGen uniformGen;
public PikeMovement(Pilot pilot) {
uniformGen = new UniformGen(pilot.getRandomStream(), new UniformDist());
}
@InitTransientParameters
public void initTransientParameters(Pilot pilot) {
uniformGen = new UniformGen(pilot.getRandomStream(), new UniformDist(0,1));
}
@InitTransientParameters
public void initTransientParameters(Pilot pilot) {
uniformGen = new UniformGen(pilot.getRandomStream(), new UniformDist(0, 1));
}
@Override
protected void doProcess(Pike pike, PikesGroup group) {
final List<Cell> surrounding = group.getEnvironment().
getNeighbours(pike.getPosition());
final List<Cell> surrounding = group.getEnvironment().getNeighbours(pike.getPosition(), distance);
// the first possiblity is the cell where the prey is
List<Cell> possibilities = new ArrayList<Cell>();
......
Supports Markdown
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