[77] | 1 | package com.framsticks.model; |
---|
| 2 | |
---|
[78] | 3 | import com.framsticks.params.FramsClass; |
---|
[84] | 4 | import com.framsticks.util.math.Point3d; |
---|
[77] | 5 | |
---|
| 6 | import java.util.ArrayList; |
---|
| 7 | import java.util.List; |
---|
| 8 | |
---|
[79] | 9 | public class Creature { |
---|
[77] | 10 | public String name; |
---|
| 11 | |
---|
| 12 | public String genotype; |
---|
| 13 | |
---|
| 14 | public String info; |
---|
| 15 | |
---|
| 16 | public Object group; |
---|
| 17 | |
---|
| 18 | public Integer generation; |
---|
| 19 | public Integer getGnum() { return generation; } |
---|
| 20 | public void setGnum(Integer gnum) { generation = gnum; } |
---|
| 21 | |
---|
| 22 | public Integer buildProblems; |
---|
| 23 | public Integer getBuildproblems() { return buildProblems; } |
---|
| 24 | public void setBuildproblems(Integer buildproblems) { buildProblems = buildproblems; } |
---|
| 25 | |
---|
| 26 | public Double startingEnergy; |
---|
| 27 | public Double getEnerg0() { return startingEnergy; } |
---|
| 28 | public void setEnerg0(Double energ0) { startingEnergy = energ0; } |
---|
| 29 | |
---|
| 30 | public Double idlePowerConsumption; |
---|
| 31 | public Double getIdleen() { return idlePowerConsumption; } |
---|
| 32 | public void setIdleen(Double idleen) { idlePowerConsumption = idleen; } |
---|
| 33 | |
---|
| 34 | public Double energy; |
---|
| 35 | |
---|
| 36 | public Double energyIncome; |
---|
| 37 | public Double getEnergy_p() { return energyIncome; } |
---|
| 38 | public void setEnergy_p(Double energy_p) { energyIncome = energy_p; } |
---|
| 39 | |
---|
| 40 | public Double energyCosts; |
---|
| 41 | public Double getEnergy_m() { return energyCosts; } |
---|
| 42 | public void setEnergy_m(Double energy_m) { energyCosts = energy_m; } |
---|
| 43 | |
---|
| 44 | public Double energyBalance; |
---|
| 45 | public Double getEnergy_b() { return energyBalance; } |
---|
| 46 | public void setEnergy_b(Double energy_b) { energyBalance = energy_b; } |
---|
| 47 | |
---|
| 48 | public Integer performanceCalculation; |
---|
| 49 | public Integer getPerf() { return performanceCalculation; } |
---|
| 50 | public void setPerf(Integer perf) { performanceCalculation = perf; } |
---|
| 51 | |
---|
| 52 | public Boolean neuralNetworkEnabled; |
---|
| 53 | |
---|
| 54 | public Boolean getNnenabled() { return neuralNetworkEnabled; } |
---|
| 55 | public void setNnenabled(Boolean nnenabled) { neuralNetworkEnabled = nnenabled; } |
---|
| 56 | |
---|
| 57 | public Boolean bodySimulation; |
---|
| 58 | public Boolean getBodysim() { return bodySimulation; } |
---|
| 59 | public void setBodysim(Boolean bodysim) { bodySimulation = bodysim; } |
---|
| 60 | |
---|
| 61 | public Boolean selfCollisions; |
---|
| 62 | public Boolean getSelfcol() { return selfCollisions; } |
---|
| 63 | public void setSelfcol(Boolean selfcol) { selfCollisions = selfcol; } |
---|
| 64 | |
---|
| 65 | public Integer lifeSpan; |
---|
| 66 | public Integer getLifespan() { return lifeSpan; } |
---|
| 67 | public void setLifespan(Integer lifespan) { lifeSpan = lifespan; } |
---|
| 68 | |
---|
| 69 | public Double distance; |
---|
| 70 | |
---|
| 71 | public Double currentVelocity; |
---|
| 72 | public Double getC_velocity() { return currentVelocity; } |
---|
| 73 | public void setC_velocity(Double c_velocity) { currentVelocity = c_velocity; } |
---|
| 74 | |
---|
| 75 | public Double currentVerticalVelocity; |
---|
| 76 | public Double getC_vertvelocity() { return currentVerticalVelocity; } |
---|
| 77 | public void setC_vertvelocity(Double c_vertvelocity) { currentVerticalVelocity = c_vertvelocity; } |
---|
| 78 | |
---|
| 79 | public Double currentVerticalPosition; |
---|
| 80 | public Double getC_vertpos() { return currentVerticalPosition; } |
---|
| 81 | public void setC_vertpos(Double c_vertpos) { currentVerticalPosition = c_vertpos; } |
---|
| 82 | |
---|
| 83 | public Double averageVelocity; |
---|
| 84 | public Double getVelocity() { return averageVelocity; } |
---|
| 85 | public void setVelocity(Double c_velocity) { averageVelocity = c_velocity; } |
---|
| 86 | |
---|
| 87 | public Double averageVerticalVelocity; |
---|
| 88 | public Double getVertvel() { return averageVerticalVelocity; } |
---|
| 89 | public void setVertvel(Double c_vertvelocity) { averageVerticalVelocity = c_vertvelocity; } |
---|
| 90 | |
---|
| 91 | public Double averageVerticalPosition; |
---|
| 92 | public Double getVertpos() { return averageVerticalPosition; } |
---|
| 93 | public void setVertpos(Double c_vertpos) { averageVerticalPosition = c_vertpos; } |
---|
| 94 | |
---|
[78] | 95 | /** pos_x, pos_y, pos_z*/ |
---|
| 96 | public double pos_x, pos_y, pos_z; |
---|
[77] | 97 | |
---|
[78] | 98 | public Point3d getPosition() { return new Point3d(pos_x, pos_y, pos_z) ; } |
---|
| 99 | public void setPosition(Point3d pos) { pos_x = pos.x; pos_y = pos.y; pos_z = pos.z; } |
---|
[77] | 100 | |
---|
[78] | 101 | public double size_x, size_y, size_z; |
---|
[77] | 102 | |
---|
[78] | 103 | public Point3d getBoundingBox() { return new Point3d(size_x, size_y, size_z) ; } |
---|
| 104 | public void setBoundingBox(Point3d size) { size_x = size.x; size_y = size.y; size_z = size.z; } |
---|
[77] | 105 | |
---|
| 106 | |
---|
[78] | 107 | /** center_x, center_y, center_z*/ |
---|
| 108 | public double center_x, center_y, center_z; |
---|
[77] | 109 | |
---|
[78] | 110 | public Point3d getCenter() { return new Point3d(center_x, center_y, center_z) ; } |
---|
| 111 | public void setCenter(Point3d center) { center_x = center.x; center_y = center.y; center_z = center.z; } |
---|
[77] | 112 | |
---|
| 113 | public Integer getNumparts() { return parts.size(); } |
---|
| 114 | public void setNumparts(Integer numparts) { } |
---|
| 115 | |
---|
| 116 | public Integer getNumjoints() { return joints.size(); } |
---|
| 117 | public void setNumjoints(Integer numjoints) { } |
---|
| 118 | |
---|
| 119 | public Integer getNumneurons() { return neurons.size(); } |
---|
| 120 | public void setNumneurons(Integer numneurons) { } |
---|
| 121 | |
---|
| 122 | public Object[] userFields = new Object[3]; |
---|
| 123 | public Object getUser1() { return userFields[0]; } |
---|
| 124 | public void setUser1(Object user1) { userFields[0] = user1; } |
---|
| 125 | |
---|
| 126 | public Object getUser2() { return userFields[1]; } |
---|
| 127 | public void setUser2(Object user2) { userFields[1] = user2; } |
---|
| 128 | |
---|
| 129 | public Object getUser3() { return userFields[2]; } |
---|
| 130 | public void setUser3(Object user3) { userFields[2] = user3; } |
---|
| 131 | |
---|
| 132 | public Integer selfCollisionMask; |
---|
| 133 | public Integer getSelfmask() { return selfCollisionMask; } |
---|
| 134 | public void setSelfmask(Integer selfmask) { selfCollisionMask = selfmask; } |
---|
| 135 | |
---|
| 136 | public Integer otherCollisionMask; |
---|
| 137 | public Integer getOthermask() { return otherCollisionMask; } |
---|
| 138 | public void setOthermask(Integer othermask) { otherCollisionMask = othermask; } |
---|
| 139 | |
---|
| 140 | public String uid; |
---|
| 141 | |
---|
| 142 | public Integer index; |
---|
| 143 | |
---|
| 144 | public final List<Part> parts = new ArrayList<Part>(); |
---|
| 145 | public final List<Joint> joints = new ArrayList<Joint>(); |
---|
| 146 | public final List<NeuroDef> neurodefs = new ArrayList<NeuroDef>(); |
---|
| 147 | |
---|
[78] | 148 | public final List<Part> getParts() { return parts; } |
---|
| 149 | public final List<Joint> getJoints() { return joints; } |
---|
| 150 | public final List<NeuroDef> getNeuroDefs() { return neurodefs; } |
---|
[77] | 151 | |
---|
[79] | 152 | public final List<MechPart> mechparts = new ArrayList<MechPart>(); |
---|
| 153 | public final List<MechJoint> mechjoints = new ArrayList<MechJoint>(); |
---|
| 154 | public final List<Neuro> neurons = new ArrayList<Neuro>(); |
---|
[78] | 155 | |
---|
[79] | 156 | public final List<MechPart> getMechParts() { return mechparts; } |
---|
| 157 | public final List<MechJoint> getMechJoints() { return mechjoints; } |
---|
| 158 | public final List<Neuro> getNeurons() { return neurons; } |
---|
[78] | 159 | |
---|
[79] | 160 | |
---|
| 161 | |
---|
[78] | 162 | public static void constructFramsClass(FramsClass.Constructor constructor) { |
---|
| 163 | constructor.field("name"); |
---|
| 164 | constructor.field("parts"); |
---|
| 165 | constructor.field("joints"); |
---|
| 166 | constructor.field("neurodefs"); |
---|
[79] | 167 | constructor.field("mechparts"); |
---|
| 168 | constructor.field("mechjoints"); |
---|
| 169 | constructor.field("neurons"); |
---|
[78] | 170 | } |
---|
| 171 | |
---|
[77] | 172 | } |
---|