sim.app.celegans.Celegans Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mason Show documentation
Show all versions of mason Show documentation
MASON is a fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations, and also to provide more than enough functionality for many lightweight simulation needs. MASON contains both a model library and an optional suite of visualization tools in 2D and 3D.
The newest version!
/*
Copyright 2006 by Sean Luke and George Mason University
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package sim.app.celegans;
import sim.engine.*;
import sim.field.continuous.*;
import sim.field.network.*;
import sim.util.*;
public class Celegans extends SimState
{
private static final long serialVersionUID = 1;
public Continuous3D cells;
public Continuous3D neurons;
public Network synapses;
Cells database;
public Celegans(long seed)
{
super(seed);
}
public void start()
{
super.start();
if (database == null) database = new Cells(); // only load at start() time, and only ONCE
cells = new Continuous3D(100, 100, 100, 100);
neurons = new Continuous3D(100, 100, 100, 100);
synapses = new Network();
Cell p0 = database.P0;
p0.stopper = schedule.scheduleRepeating(p0);
p0.step(this); // have p0 add himself to the continuous3D. Yes, I know this is unusual, but it's kosher. Sort of.
schedule.scheduleOnce(1000, -1, new Steppable() { public void step(SimState state) { state.kill(); } }); // kill the simulation at around 600, before the cells all die at 1000
}
public static void main(String[] args)
{
doLoop(Celegans.class, args);
System.exit(0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy