class lattice { creature parent; cell nodes[]; int amount=0; float minDistance=20; //The minimal distance two cells can bond by spring. If less than this, it will MAKE the cells equal this distance float maxDistance=150; float collisionDistance; //Distance where collisions between cells will happen float cohesionDistance; //Distance where cells are able to attatch to each other via spring. Default value found on Creature class float tension=0.7; float collisionTension=.5; float collisionDamping=.4; float springDamping=.35; float totalEnergy=0; boolean stable=true; float mostDistant=0; position averagePos; int numExposed=0; lattice(lattice l,creature pa) { nodes=new cell[l.nodes.length]; amount=l.amount; System.arraycopy(l.nodes,0,nodes,0,nodes.length); parent=pa; cohesionDistance=l.cohesionDistance; collisionDistance=l.collisionDistance; } lattice(int a,creature pa) { parent=pa; amount=a; nodes=new cell[amount]; cohesionDistance=pa.cohesionDistance; collisionDistance=pa.collisionDistance; } void update() { doMuscles(); doConnectedSprings(); doCollideSprings(); mostDistant=0; totalEnergy=0; float avx=0; float avy=0; for(int i=0;i160) stable=false; else stable=true; } boolean allTypes() { boolean hasNeurons=false; boolean hasSensors=false; boolean hasMuscle=false; for(int i=0;i