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