public X_Movement_Module getCopy() { X_Movement_Module r = new X_Movement_Module(); r.attractants = (Vector<String>) this.attractants.clone(); r.repellents = (Vector<String>) this.repellents.clone(); r.randomness = this.randomness; r.movementDirection = this.movementDirection.clone(); r.directionWeight = this.directionWeight; r.copiedWhenNeuriteBranches = this.copiedWhenNeuriteBranches; r.minimalBranchDiameter = this.minimalBranchDiameter; r.cantLeave = this.cantLeave; r.maxConcentration = this.maxConcentration; r.linearDiameterDecrease = this.linearDiameterDecrease; return r; }
public static void main(String[] args) { // 1) Prepare the environment : // get a reference to the extracelular matrix (ECM) ECM ecm = ECM.getInstance(); // add additional PhysicalNodes (for diffusion) int nbOfAdditionalNodes = 100; for (int i = 0; i < nbOfAdditionalNodes; i++) { double[] coord = randomNoise(500, 3); ecm.getPhysicalNodeInstance(coord); } // 2) Create some artificial chemical gradients // horizontal gaussian (peak concentration, peak coordinate, variance) ecm.addArtificialGaussianConcentrationZ(new Substance("A", Color.red), 1, 300, 100); ecm.addArtificialGaussianConcentrationZ(new Substance("B", Color.blue), 1, 00, 100); ecm.addArtificialGaussianConcentrationZ(new Substance("C", Color.green), 1, -300, 100); // horizontal linerar gradient ecm.addArtificialLinearConcentrationZ(new Substance("D", Color.cyan), 1, 300, -300); // vertical gaussian ecm.addArtificialGaussianConcentrationX(new Substance("E", Color.red), 1, 0, 100); ecm.addArtificialGaussianConcentrationX(new Substance("F", Color.green), 1, 300, 100); // 3) Create a 4-uple Cell-SomaElement-PhysicalSphere-SpaceNode at the desired location double[] cellLocation = new double[] {0, 0, 0}; Cell cell = CellFactory.getCellInstance(cellLocation); cell.setColorForAllPhysicalObjects(Param.RED); // 4) Extend an axon from the cell NeuriteElement neurite = cell.getSomaElement().extendNewNeurite(new double[] {0, 0, 1}); neurite.getPhysical().setDiameter(1.0); neurite.getPhysicalCylinder().setDiameter(3); // 5) Put a movementReceptor X_Movement_Module r = new X_Movement_Module(); r.linearDiameterDecrease = 0.01; r.addAttractant("A"); neurite.addLocalBiologyModule(r); // 6) Simulate Scheduler.simulate(); }