Changeset 86 for java/main/src/main/java/com/framsticks/model
- Timestamp:
- 06/26/13 13:27:31 (11 years ago)
- Location:
- java/main/src/main/java/com/framsticks/model
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/model/BaseJoint.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.ParamAnnotation; 3 4 import com.framsticks.util.math.Point3d; 4 5 … … 8 9 public class BaseJoint { 9 10 10 /** stif */ 11 public Double stiffness; 12 public Double getStif() { return stiffness; } 13 public void setStif(Double stif) { stiffness = stif; } 11 @ParamAnnotation(id = "stif") 12 public double stiffness; 14 13 15 /** rotstif */ 16 public Double rotationStiffness; 17 public Double getRotstif() { return rotationStiffness; } 18 public void setRotstif(Double rotstif) { rotationStiffness = rotstif; } 14 @ParamAnnotation(id = "rotstif") 15 public double rotationStiffness; 19 16 20 /** rx, ry, rz*/17 @ParamAnnotation 21 18 public double rx, ry, rz; 22 19 … … 24 21 public void setRotation(Point3d r) { rx = r.x; ry = r.y; rz = r.z; } 25 22 26 /** dx, dy, dz*/23 @ParamAnnotation 27 24 public double dx, dy, dz; 28 25 -
java/main/src/main/java/com/framsticks/model/BaseNeuro.java
r78 r86 1 1 package com.framsticks.model; 2 3 import com.framsticks.params.annotations.ParamAnnotation; 2 4 3 5 /** … … 5 7 */ 6 8 public class BaseNeuro { 7 /** inputCount */ 8 public Integer inputCount; 9 public Integer getGetInputCount() { return inputCount; } 10 public void setGetInputCount(Integer getInputCount) { inputCount = getInputCount; } 9 10 @ParamAnnotation(id = "getInputCount") 11 public int inputCount; 11 12 12 13 -
java/main/src/main/java/com/framsticks/model/BasePart.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.ParamAnnotation; 3 4 import com.framsticks.util.math.Orientation; 4 5 import com.framsticks.util.math.Point3d; … … 8 9 */ 9 10 public class BasePart { 10 /** x, y, z */ 11 12 @ParamAnnotation 11 13 public double x, y, z; 12 14 … … 14 16 public void setPosition(Point3d p) { x = p.x; y = p.y; z = p.z; } 15 17 16 /** m */ 17 public Double mass = 0.0; 18 public Double getM() { return mass; } 19 public void setM(Double m) { mass = m; } 18 @ParamAnnotation(id = "m") 19 public double mass = 0.0; 20 20 21 /** s */ 22 public Double size = 0.0; 23 public Double getS() { return size; } 24 public void setS(Double s) { size = s; } 21 @ParamAnnotation(id = "s") 22 public double size = 0.0; 25 23 26 /** fr */ 27 public Double friction; 28 public Double getFr() { return friction; } 29 public void setFr(Double fr) { friction = fr; } 24 @ParamAnnotation(id = "fr") 25 public double friction; 30 26 31 27 @ParamAnnotation 32 28 public double oxx, oxy, oxz, oyx, oyy, oyz, ozx, ozy, ozz; 33 29 -
java/main/src/main/java/com/framsticks/model/Creature.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.FramsClass; 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 4 5 import com.framsticks.util.math.Point3d; 5 6 … … 7 8 import java.util.List; 8 9 10 @FramsClassAnnotation 9 11 public class Creature { 12 13 @ParamAnnotation 10 14 public String name; 11 15 16 @ParamAnnotation 12 17 public String genotype; 13 18 19 @ParamAnnotation 14 20 public String info; 15 21 22 @ParamAnnotation 16 23 public Object group; 17 24 18 public Integer generation; 19 public Integer getGnum() { return generation; } 20 public void setGnum(Integer gnum) { generation = gnum; } 25 @ParamAnnotation(id = "gnum") 26 public int generation; 21 27 22 public Integer buildProblems; 23 public Integer getBuildproblems() { return buildProblems; } 24 public void setBuildproblems(Integer buildproblems) { buildProblems = buildproblems; } 28 @ParamAnnotation(id = "buildproblems") 29 public int buildProblems; 25 30 26 public Double startingEnergy; 27 public Double getEnerg0() { return startingEnergy; } 28 public void setEnerg0(Double energ0) { startingEnergy = energ0; } 31 @ParamAnnotation(id = "energ0") 32 public double startingEnergy; 29 33 30 public Double idlePowerConsumption; 31 public Double getIdleen() { return idlePowerConsumption; } 32 public void setIdleen(Double idleen) { idlePowerConsumption = idleen; } 34 @ParamAnnotation(id = "idleen") 35 public double idlePowerConsumption; 33 36 34 public Double energy; 37 @ParamAnnotation 38 public double energy; 35 39 36 public Double energyIncome; 37 public Double getEnergy_p() { return energyIncome; } 38 public void setEnergy_p(Double energy_p) { energyIncome = energy_p; } 40 @ParamAnnotation(id = "energy_p") 41 public double energyIncome; 39 42 40 public Double energyCosts; 41 public Double getEnergy_m() { return energyCosts; } 42 public void setEnergy_m(Double energy_m) { energyCosts = energy_m; } 43 @ParamAnnotation(id = "energy_m") 44 public double energyCosts; 43 45 44 public Double energyBalance; 45 public Double getEnergy_b() { return energyBalance; } 46 public void setEnergy_b(Double energy_b) { energyBalance = energy_b; } 46 @ParamAnnotation(id = "energy_b") 47 public double energyBalance; 47 48 48 public Integer performanceCalculation; 49 public Integer getPerf() { return performanceCalculation; } 50 public void setPerf(Integer perf) { performanceCalculation = perf; } 49 @ParamAnnotation(id = "perf") 50 public int performanceCalculation; 51 51 52 public Boolean neuralNetworkEnabled; 52 @ParamAnnotation(id = "nnenabled") 53 public boolean neuralNetworkEnabled; 53 54 54 public Boolean getNnenabled() { return neuralNetworkEnabled; }55 public void setNnenabled(Boolean nnenabled) { neuralNetworkEnabled = nnenabled; }55 @ParamAnnotation(id = "bodysim") 56 public boolean bodySimulation; 56 57 57 public Boolean bodySimulation; 58 public Boolean getBodysim() { return bodySimulation; } 59 public void setBodysim(Boolean bodysim) { bodySimulation = bodysim; } 58 @ParamAnnotation(id = "selfcol") 59 public boolean selfCollisions; 60 60 61 public Boolean selfCollisions; 62 public Boolean getSelfcol() { return selfCollisions; } 63 public void setSelfcol(Boolean selfcol) { selfCollisions = selfcol; } 61 @ParamAnnotation(id = "lifespan") 62 public int lifeSpan; 64 63 65 public Integer lifeSpan; 66 public Integer getLifespan() { return lifeSpan; } 67 public void setLifespan(Integer lifespan) { lifeSpan = lifespan; } 64 @ParamAnnotation 65 public double distance; 68 66 69 public Double distance; 67 @ParamAnnotation(id = "c_velocity") 68 public double currentVelocity; 70 69 71 public Double currentVelocity; 72 public Double getC_velocity() { return currentVelocity; } 73 public void setC_velocity(Double c_velocity) { currentVelocity = c_velocity; } 70 @ParamAnnotation(id = "c_vertvelocity") 71 public double currentVerticalVelocity; 74 72 75 public Double currentVerticalVelocity; 76 public Double getC_vertvelocity() { return currentVerticalVelocity; } 77 public void setC_vertvelocity(Double c_vertvelocity) { currentVerticalVelocity = c_vertvelocity; } 73 @ParamAnnotation(id = "c_vertpos") 74 public double currentVerticalPosition; 78 75 79 public Double currentVerticalPosition; 80 public Double getC_vertpos() { return currentVerticalPosition; } 81 public void setC_vertpos(Double c_vertpos) { currentVerticalPosition = c_vertpos; } 76 @ParamAnnotation(id = "velocity") 77 public double averageVelocity; 82 78 83 public Double averageVelocity; 84 public Double getVelocity() { return averageVelocity; } 85 public void setVelocity(Double c_velocity) { averageVelocity = c_velocity; } 79 @ParamAnnotation(id = "vertvel") 80 public double averageVerticalVelocity; 86 81 87 public Double averageVerticalVelocity; 88 public Double getVertvel() { return averageVerticalVelocity; } 89 public void setVertvel(Double c_vertvelocity) { averageVerticalVelocity = c_vertvelocity; } 82 @ParamAnnotation(id = "vertpos") 83 public double averageVerticalPosition; 90 84 91 public Double averageVerticalPosition; 92 public Double getVertpos() { return averageVerticalPosition; } 93 public void setVertpos(Double c_vertpos) { averageVerticalPosition = c_vertpos; } 94 95 /** pos_x, pos_y, pos_z*/ 85 @ParamAnnotation 96 86 public double pos_x, pos_y, pos_z; 97 87 … … 99 89 public void setPosition(Point3d pos) { pos_x = pos.x; pos_y = pos.y; pos_z = pos.z; } 100 90 91 @ParamAnnotation 101 92 public double size_x, size_y, size_z; 102 93 … … 106 97 107 98 /** center_x, center_y, center_z*/ 99 @ParamAnnotation 108 100 public double center_x, center_y, center_z; 109 101 … … 111 103 public void setCenter(Point3d center) { center_x = center.x; center_y = center.y; center_z = center.z; } 112 104 113 public Integer getNumparts() { return parts.size(); } 114 public void setNumparts(Integer numparts) { } 105 @ParamAnnotation 106 public int getNumparts() { return parts.size(); } 107 @ParamAnnotation 108 public void setNumparts(int numparts) { } 115 109 116 public Integer getNumjoints() { return joints.size(); } 117 public void setNumjoints(Integer numjoints) { } 110 @ParamAnnotation 111 public int getNumjoints() { return joints.size(); } 112 @ParamAnnotation 113 public void setNumjoints(int numjoints) { } 118 114 119 public Integer getNumneurons() { return neurons.size(); } 120 public void setNumneurons(Integer numneurons) { } 115 @ParamAnnotation 116 public int getNumneurons() { return neurons.size(); } 117 @ParamAnnotation 118 public void setNumneurons(int numneurons) { } 121 119 122 120 public Object[] userFields = new Object[3]; 121 @ParamAnnotation 123 122 public Object getUser1() { return userFields[0]; } 123 @ParamAnnotation 124 124 public void setUser1(Object user1) { userFields[0] = user1; } 125 125 126 @ParamAnnotation 126 127 public Object getUser2() { return userFields[1]; } 128 @ParamAnnotation 127 129 public void setUser2(Object user2) { userFields[1] = user2; } 128 130 131 @ParamAnnotation 129 132 public Object getUser3() { return userFields[2]; } 133 @ParamAnnotation 130 134 public void setUser3(Object user3) { userFields[2] = user3; } 131 135 132 public Integer selfCollisionMask; 133 public Integer getSelfmask() { return selfCollisionMask; } 134 public void setSelfmask(Integer selfmask) { selfCollisionMask = selfmask; } 136 @ParamAnnotation(id = "selfmask") 137 public int selfCollisionMask; 135 138 136 public Integer otherCollisionMask; 137 public Integer getOthermask() { return otherCollisionMask; } 138 public void setOthermask(Integer othermask) { otherCollisionMask = othermask; } 139 @ParamAnnotation(id = "othermask") 140 public int otherCollisionMask; 139 141 142 @ParamAnnotation(id = "selfcolstate") 143 public boolean selfCollisionsState; 144 145 @ParamAnnotation 140 146 public String uid; 141 147 142 public Integer index; 148 @ParamAnnotation 149 public int index; 143 150 151 @ParamAnnotation 144 152 public final List<Part> parts = new ArrayList<Part>(); 153 @ParamAnnotation 145 154 public final List<Joint> joints = new ArrayList<Joint>(); 155 @ParamAnnotation 146 156 public final List<NeuroDef> neurodefs = new ArrayList<NeuroDef>(); 147 157 … … 150 160 public final List<NeuroDef> getNeuroDefs() { return neurodefs; } 151 161 162 @ParamAnnotation 152 163 public final List<MechPart> mechparts = new ArrayList<MechPart>(); 164 @ParamAnnotation 153 165 public final List<MechJoint> mechjoints = new ArrayList<MechJoint>(); 166 @ParamAnnotation 154 167 public final List<Neuro> neurons = new ArrayList<Neuro>(); 155 168 … … 158 171 public final List<Neuro> getNeurons() { return neurons; } 159 172 160 161 162 public static void constructFramsClass(FramsClass.Constructor constructor) {163 constructor.field("name");164 constructor.field("parts");165 constructor.field("joints");166 constructor.field("neurodefs");167 constructor.field("mechparts");168 constructor.field("mechjoints");169 constructor.field("neurons");170 }171 172 173 } -
java/main/src/main/java/com/framsticks/model/Genotype.java
r84 r86 1 1 package com.framsticks.model; 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 2 5 3 6 4 7 // import org.apache.log4j.Logger; 5 8 9 @FramsClassAnnotation 6 10 public class Genotype extends Model { 7 11 // private final static Logger log = Logger.getLogger(Genotype.class); 8 12 13 @ParamAnnotation 9 14 public String name; 15 16 @ParamAnnotation 10 17 public String genotype; 18 19 @ParamAnnotation 11 20 public String info; 12 21 13 public Double similarity; 14 public Double getSimi() { return similarity; } 15 public void setSimi(Double simi) { similarity = simi; } 22 @ParamAnnotation(id = "simi") 23 public double similarity; 16 24 17 public Double brainConnections; 18 public Double getNumconnections() { return brainConnections; } 19 public void setNumconnections(Double numconnections) { brainConnections = numconnections; } 25 @ParamAnnotation(id = "numconnections") 26 public double brainConnections; 20 27 21 public Integer ordinalNumber; 22 public Integer getNum() { return ordinalNumber; } 23 public void setNum(Integer num) { ordinalNumber = num; } 28 @ParamAnnotation(id = "num") 29 public int ordinalNumber; 24 30 25 public Integer generation; 26 public Integer getGnum() { return generation; } 27 public void setGnum(Integer gnum) { generation = gnum; } 31 @ParamAnnotation(id = "gnum") 32 public int generation; 28 33 29 public Integer instances; 34 @ParamAnnotation 35 public int instances; 30 36 31 public Integer lifeSpan; 32 public Integer getLifespan() { return lifeSpan; } 33 public void setLifespan(Integer lifespan) { lifeSpan = lifespan; } 37 @ParamAnnotation(id = "lifespan") 38 public double lifeSpan; 34 39 35 public Double velocity;36 public Double distance;40 @ParamAnnotation 41 public double velocity; 37 42 38 public Double verticalVelocity; 39 public Double getVertvel() { return verticalVelocity; } 40 public void setVertvel(Double vertvel) { verticalVelocity = vertvel; } 43 @ParamAnnotation 44 public double distance; 41 45 42 public Double verticalPosition; 43 public Double getVertpos() { return verticalPosition; } 44 public void setVertpos(Double vertpos) { verticalPosition = vertpos; } 46 @ParamAnnotation(id = "vertvel") 47 public double verticalVelocity; 45 48 46 public Double fitness; 47 public Double getFit() { return fitness; } 48 public void setFit(Double fit) { fitness = fit; } 49 @ParamAnnotation(id = "vertpos") 50 public double verticalPosition; 49 51 50 public Double finalFitness; 51 public Double getFit2() { return finalFitness; } 52 public void setFit2(Double fit2) { finalFitness = fit2; } 52 @ParamAnnotation(id = "fit") 53 public double fitness; 53 54 55 @ParamAnnotation(id = "fit2") 56 public double finalFitness; 57 58 @ParamAnnotation(id = "f0genotype") 54 59 public String genotypeInF0; 55 public String getF0genotype() { return genotypeInF0; }56 public void setF0genotype(String f0genotype) { genotypeInF0 = f0genotype; }57 60 61 @ParamAnnotation(id = "convtrace1") 58 62 public String conversionBacktrace; 59 public String getConvtrace1() { return conversionBacktrace; } 60 public void setConvtrace1(String convtrace1) { conversionBacktrace = convtrace1; } 63 64 @ParamAnnotation 65 public boolean isValid; 61 66 62 67 public Object[] userFields = new Object[3]; 68 @ParamAnnotation 63 69 public Object getUser1() { return userFields[0]; } 70 @ParamAnnotation 64 71 public void setUser1(Object user1) { userFields[0] = user1; } 65 72 73 @ParamAnnotation 66 74 public Object getUser2() { return userFields[1]; } 75 @ParamAnnotation 67 76 public void setUser2(Object user2) { userFields[1] = user2; } 68 77 78 @ParamAnnotation 69 79 public Object getUser3() { return userFields[2]; } 80 @ParamAnnotation 70 81 public void setUser3(Object user3) { userFields[2] = user3; } 71 82 83 @ParamAnnotation 72 84 public String uid; 85 86 @ParamAnnotation 87 public double getStrsiz() { return getNumparts(); } 88 @ParamAnnotation 89 public void setStrsiz(double strsiz) { setNumparts(strsiz); } 90 91 92 @ParamAnnotation 93 public double getStrjoints() { return getNumjoints(); } 94 @ParamAnnotation 95 public void setStrjoints(double strjoints) { setNumjoints(strjoints); } 96 97 98 @ParamAnnotation 99 public double getNnsiz() { return getNumneurons(); } 100 @ParamAnnotation 101 public void setNnsiz(double nnsiz) { setNumneurons(nnsiz); } 102 103 104 @ParamAnnotation 105 public double getNncon() { return brainConnections; } 106 @ParamAnnotation 107 public void setNncon(double nncon) { this.brainConnections = nncon; } 108 109 @ParamAnnotation 110 public int getPopsiz() { return instances; } 111 @ParamAnnotation 112 public void setPopsiz(int popsiz) { this.instances = popsiz; } 113 73 114 74 115 } -
java/main/src/main/java/com/framsticks/model/Joint.java
r84 r86 1 1 package com.framsticks.model; 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 2 5 3 6 /** … … 6 9 * All accessors are used by ReflectionAccess. 7 10 */ 11 @FramsClassAnnotation(id = "j") 8 12 public class Joint extends BaseJoint { 9 13 10 /** i */14 @ParamAnnotation(id = "i") 11 15 public String info; 12 public String getI() { return info; }13 public void setI(String i) { info = i; }14 16 15 /** p1 */ 16 public Integer part1; 17 public void setP1(Integer p1) { part1 = p1; } 18 public Integer getP1() { return part1; } 17 @ParamAnnotation(id = "p1") 18 public int part1; 19 19 20 /** p2 */ 21 public Integer part2; 22 public void setP2(Integer p2) { part2 = p2; } 23 public Integer getP2() { return part2; } 20 @ParamAnnotation(id = "p2") 21 public int part2; 24 22 23 @ParamAnnotation(id = "stam") 24 public double stamina; 25 25 26 /** stam */ 27 public Double stamina; 28 public Double getStam() { return stamina; } 29 public void setStam(Double stam) { stamina = stam; } 26 @ParamAnnotation(id = "Vstyle") 27 public String visualizationStyle; 30 28 29 @ParamAnnotation 30 public double vr, vg, vb; 31 31 32 /** Vstyle */33 public String visualizationStyle;34 public String getVstyle() { return visualizationStyle; }35 public void setVstyle(String Vstyle) { visualizationStyle = Vstyle; }36 32 } -
java/main/src/main/java/com/framsticks/model/MechJoint.java
r84 r86 1 1 package com.framsticks.model; 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 2 5 3 6 /** 4 7 * @author Piotr Sniegowski 5 8 */ 9 @FramsClassAnnotation 6 10 public class MechJoint extends BaseJoint { 7 11 8 /** stress */ 9 public Double stress; 10 public Double getStress() { return stress; } 11 public void setStress(Double stress) { this.stress = stress; } 12 @ParamAnnotation 13 public double stress; 12 14 13 /** rotstress */ 14 public Double rotationStress; 15 public Double getRotstress() { return rotationStress; } 16 public void setRotstress(Double rotstress) { rotationStress = rotstress; } 15 @ParamAnnotation(id = "rotstress") 16 public double rotationStress; 17 17 } -
java/main/src/main/java/com/framsticks/model/MechPart.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 3 5 import com.framsticks.util.math.Point3d; 4 6 5 7 /* 6 8 */ 9 @FramsClassAnnotation 7 10 public class MechPart extends BasePart { 8 11 9 /** vol */ 10 public Double volume = 0.0; 11 public Double getVol() { return volume; } 12 public void setVol(Double vol) { volume = vol; } 12 @ParamAnnotation(id = "vol") 13 public double volume = 0.0; 13 14 14 /** vx, vy, vz*/15 @ParamAnnotation 15 16 public double vx, vy, vz; 16 17 -
java/main/src/main/java/com/framsticks/model/Model.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 3 5 import com.framsticks.util.lang.Casting; 4 6 import com.framsticks.util.lang.Containers; … … 14 16 * Author: Piotr Śniegowski 15 17 */ 18 @FramsClassAnnotation(id = "m") 16 19 public class Model { 17 20 18 21 private final static Logger log = Logger.getLogger(Model.class); 19 22 20 public Double startingEnergy; 21 public Double getEnerg0() { return startingEnergy; } 22 public void setEnerg0(Double energ0) { startingEnergy = energ0; } 23 @ParamAnnotation(id = "se") 24 public double startingEnergy; 23 25 24 public Double getSe() { return startingEnergy; } 25 public void setSe(Double se) { startingEnergy = se; } 26 @ParamAnnotation 27 public double getEnerg0() { return startingEnergy; } 28 @ParamAnnotation 29 public void setEnerg0(double energ0) { startingEnergy = energ0; } 26 30 27 /** Vstyle */ 31 32 @ParamAnnotation(id = "Vstyle") 28 33 public String visualizationStyle; 29 public String getVstyle() { return visualizationStyle; }30 public void setVstyle(String Vstyle) { visualizationStyle = Vstyle; }31 34 35 @ParamAnnotation 32 36 public final List<Part> parts = new ArrayList<Part>(); 37 38 @ParamAnnotation 33 39 public final List<Joint> joints = new ArrayList<Joint>(); 40 41 @ParamAnnotation 34 42 public final List<NeuroDef> neurodefs = new ArrayList<NeuroDef>(); 35 43 36 public Double getNumparts() { return (double)parts.size(); } 37 public Double getNumjoints() { return (double)joints.size(); } 38 public Double getNumneurons() { return (double)neurodefs.size(); } 44 //TODO: why those methods returns and accepts doubles? 45 @ParamAnnotation 46 public double getNumparts() { return (double)parts.size(); } 47 @ParamAnnotation 48 public double getNumjoints() { return (double)joints.size(); } 49 @ParamAnnotation 50 public double getNumneurons() { return (double)neurodefs.size(); } 39 51 40 52 //this is impossible to use, because numparts field is marked as readonly 41 public void setNumparts(Double numparts) { Containers.resizeList(parts, (int) (double) numparts); } 42 public void setNumjoints(Double numjoints) { Containers.resizeList(joints, (int)(double)numjoints); } 43 public void setNumneurons(Double numneurons) { Containers.resizeList(neurodefs, (int)(double)numneurons); } 53 @ParamAnnotation 54 public void setNumparts(double numparts) { Containers.resizeList(parts, (int) (double) numparts); } 55 @ParamAnnotation 56 public void setNumjoints(double numjoints) { Containers.resizeList(joints, (int)(double)numjoints); } 57 @ParamAnnotation 58 public void setNumneurons(double numneurons) { Containers.resizeList(neurodefs, (int)(double)numneurons); } 44 59 45 60 public List<Part> getParts() { return parts; } … … 78 93 for (Joint j : f0Genotype.getJoints()) { 79 94 /** based on c++ Joint::attachToParts*/ 80 Part p1 = f0Genotype.parts.get(j. getP1());81 Part p2 = f0Genotype.parts.get(j. getP2());95 Part p1 = f0Genotype.parts.get(j.part1); 96 Part p2 = f0Genotype.parts.get(j.part2); 82 97 assert p1 != null && p2 != null; 83 98 Orientation o = new Orientation().rotate(j.getRotation()); -
java/main/src/main/java/com/framsticks/model/Neuro.java
r84 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 3 5 import com.framsticks.util.math.Point3d; 4 6 … … 6 8 * @author Piotr Sniegowski 7 9 */ 10 @FramsClassAnnotation 8 11 public class Neuro extends BaseNeuro { 9 12 10 public Integer channelCount; 13 @ParamAnnotation 14 public int channelCount; 11 15 12 public Double inputSum; 16 @ParamAnnotation 17 public double inputSum; 13 18 14 public Double weightedInputSum; 19 @ParamAnnotation 20 public double weightedInputSum; 15 21 16 public Double state; 22 @ParamAnnotation 23 public double state; 17 24 18 public Double currentState; 19 public Double getCurrState() { return currentState; } 20 public void setCurrState(Double currState) { currentState = currState; } 25 @ParamAnnotation(id = "currState") 26 public double currentState; 21 27 22 public Boolean hold; 28 @ParamAnnotation 29 public boolean hold; 23 30 31 @ParamAnnotation 24 32 public double position_x, position_y, position_z; 25 33 -
java/main/src/main/java/com/framsticks/model/NeuroDef.java
r78 r86 1 1 package com.framsticks.model; 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 2 5 3 6 /** 4 7 * @author Piotr Sniegowski 5 8 */ 9 @FramsClassAnnotation(id = "n") 6 10 public class NeuroDef extends BaseNeuro { 7 11 8 /** p */9 public Integerpart;12 @ParamAnnotation(id = "p") 13 public int part; 10 14 11 /** j */12 public Integerjoint;15 @ParamAnnotation(id = "j") 16 public int joint; 13 17 14 /** d */18 @ParamAnnotation(id = "d") 15 19 public String details; 16 20 17 /** i */21 @ParamAnnotation(id = "i") 18 22 public String info; 19 23 20 /** Vstyle */24 @ParamAnnotation(id = "Vstyle") 21 25 public String visualizationStyle; 22 26 23 public Integer getP() { return part; }24 public void setP(Integer p) { part = p; }25 26 public Integer getJ() { return joint; }27 public void setJ(Integer j) { joint = j; }28 29 public String getD() { return details; }30 public void setD(String d) { details = d; }31 32 public String getI() { return info; }33 public void setI(String i) { info = i; }34 35 public String getVstyle() { return visualizationStyle; }36 public void setVstyle(String Vstyle) { visualizationStyle = Vstyle; }37 38 39 40 27 } -
java/main/src/main/java/com/framsticks/model/Package.java
r84 r86 8 8 public class Package { 9 9 public static void register(Registry registry) { 10 registry.registerReflectedClass("MechPart", null, "com.framsticks.model.MechPart"); 11 registry.registerReflectedClass("Joint", "j", "com.framsticks.model.Joint"); 12 registry.registerReflectedClass("MechJoint", null, "com.framsticks.model.MechJoint"); 13 registry.registerReflectedClass("Neuro", null, "com.framsticks.model.Neuro"); 14 registry.registerReflectedClass("NeuroDef", "n", "com.framsticks.model.NeuroDef"); 15 registry.registerReflectedClass("Part", "p", "com.framsticks.model.Part"); 16 registry.registerReflectedClass("Model", "m", "com.framsticks.model.Model"); 17 registry.registerReflectedClass("Creature", null, "com.framsticks.model.Creature"); 18 registry.registerReflectedClass("Genotype", null, "com.framsticks.model.Genotype"); 19 10 registry 11 .register(MechPart.class) 12 .register(Joint.class) 13 .register(MechJoint.class) 14 .register(Neuro.class) 15 .register(NeuroDef.class) 16 .register(Part.class) 17 .register(Model.class) 18 .register(Creature.class) 19 .register(Genotype.class) 20 .register(World.class); 20 21 } 21 22 } -
java/main/src/main/java/com/framsticks/model/Part.java
r84 r86 2 2 3 3 4 import com.framsticks.params.annotations.FramsClassAnnotation; 5 import com.framsticks.params.annotations.ParamAnnotation; 4 6 import com.framsticks.util.math.Point3d; 5 7 … … 7 9 * The Class Part. 8 10 */ 11 @FramsClassAnnotation(id = "p") 9 12 public class Part extends BasePart { 10 13 11 /** rx, ry, rz*/14 @ParamAnnotation 12 15 public double rx, ry, rz; 16 13 17 14 18 public Point3d getRotation() { return new Point3d(rx, ry, rz); } 15 19 public void setRotation(Point3d r) { rx = r.x; ry = r.y; rz = r.z; } 16 20 17 /** dn */18 public Double density;21 @ParamAnnotation(id = "dn") 22 public double density; 19 23 20 /** ing */21 public Double ingestion;24 @ParamAnnotation(id = "ing") 25 public double ingestion; 22 26 23 /** as */24 public Double assimilation;27 @ParamAnnotation(id = "as") 28 public double assimilation; 25 29 26 /** i */30 @ParamAnnotation(id = "i") 27 31 public String info; 28 32 29 /** Vstyle */33 @ParamAnnotation(id = "Vstyle") 30 34 public String visualizationStyle; 31 35 32 public Double getDn() { return density; }33 public void setDn(Double dn) { density = dn; }36 @ParamAnnotation(id = "vs") 37 public double visualThickness; 34 38 35 public Double getIng() { return ingestion; } 36 public void setIng(Double ing) { ingestion = ing; } 37 38 public Double getAs() { return assimilation; } 39 public void setAs(Double as) { assimilation = as; } 40 41 public String getI() { return info; } 42 public void setI(String i) { info = i; } 43 44 public String getVstyle() { return visualizationStyle; } 45 public void setVstyle(String vstyle) { visualizationStyle = vstyle; } 39 @ParamAnnotation 40 public double vr, vg, vb; 46 41 47 42 } -
java/main/src/main/java/com/framsticks/model/World.java
r77 r86 1 1 package com.framsticks.model; 2 2 3 import com.framsticks.params.annotations.FramsClassAnnotation; 4 import com.framsticks.params.annotations.ParamAnnotation; 5 6 @FramsClassAnnotation 3 7 public class World { 4 8 5 public Integer wrldbnd; 6 public Double wrldwat; 7 public String faces; 9 @ParamAnnotation(id = "wrldbnd") 10 public int boundaries; 11 12 @ParamAnnotation(id = "wrldwat") 13 public double waterLevel; 8 14 9 15 16 @ParamAnnotation(id = "wrldtyp") 17 public int type; 18 19 @ParamAnnotation(id = "wrldsiz") 20 public double size; 21 22 @ParamAnnotation(id = "wrldmap") 23 public String map; 24 25 @ParamAnnotation(id = "wrldg") 26 public double gravity; 27 28 @ParamAnnotation(id = "simtype") 29 public int simulationEngine; 30 31 @ParamAnnotation(id = "nnspeed") 32 public double neuralNetworkSimulationSpeed; 33 34 @ParamAnnotation 35 public String faces; 10 36 /* 11 37 public static ReflectionAccess createReflection()
Note: See TracChangeset
for help on using the changeset viewer.