Permalink
Browse files

Change type for the seed in headless mode from long to double

  • Loading branch information...
1 parent f719156 commit 08d776714f7a479b9934cb6100ecea76ac2ed379 @ptaillandier ptaillandier committed Oct 7, 2016
@@ -122,7 +122,7 @@ public static void openExperiment(final IExperimentPlan experiment) {
* @param model
*/
public static synchronized IExperimentPlan addHeadlessExperiment(final IModel model, final String expName,
- final ParametersSet params, final Long seed) {
+ final ParametersSet params, final Double seed) {
final ExperimentPlan currentExperiment = (ExperimentPlan) model.getExperiment(expName);
@@ -137,7 +137,7 @@ public static synchronized IExperimentPlan addHeadlessExperiment(final IModel mo
}
currentExperiment.open();
if (seed != null) {
- currentExperiment.getAgent().setSeed(Double.longBitsToDouble(seed));
+ currentExperiment.getAgent().setSeed(seed);
}
currentExperiment.getAgent().createSimulation(new ParametersSet(), true);
@@ -24,14 +24,14 @@
public class Experiment implements IExperiment {
- public static final long DEFAULT_SEED_VALUE = 0;
+ public static final double DEFAULT_SEED_VALUE = 0;
protected IExperimentPlan currentExperiment;
protected SimulationAgent currentSimulation;
protected ParametersSet params;
protected IModel model;
protected String experimentName;
- protected long seed;
+ protected double seed;
protected long currentStep;
protected Experiment() {
@@ -59,7 +59,7 @@ public void setup(final String expName) {
}
@Override
- public void setup(final String expName, final long sd) {
+ public void setup(final String expName, final double sd) {
this.seed = sd;
this.loadCurrentExperiment(expName);
}
@@ -19,7 +19,7 @@
public IExperimentPlan getExperimentPlan();
public void setup(final String experimentName);
- public void setup(final String experimentName, final long seed);
+ public void setup(final String experimentName, final double seed);
public long step();
public boolean isInterrupted();

0 comments on commit 08d7767

Please sign in to comment.