source: java/main/src/main/java/com/framsticks/model/Creature.java @ 84

Last change on this file since 84 was 84, checked in by psniegowski, 11 years ago

HIGHLIGHTS:

  • simplification of entities management model
  • cleanup around params (improve hierarchy)
  • migrate from JUnit to TestNG
  • introduce FEST to automatically test GUI
  • improve slider control
  • loosen synchronization between gui tree and backend representation
  • and many other bug fixes

NOTICE:

  • a great many of lines is changed only because of substituting spaces with tabs

CHANGELOG (oldest changes at the bottom):

Some cleaning after fix found.

Fix bug with tree.

More changes with TreeNodes?.

Finally fix issue with tree.

Improve gui tree management.

Decouple update of values from fetch request in gui.

Minor changes.

Minor changes.

Minor change.

Change Path construction wording.

More fixes to SliderControl?.

Fix SliderControl?.

Fix SliderControl?.

Minor improvement.

Several changes.

Make NumberParam? a generic class.

Add robot to the gui test.

Setup common testing logging configuration.

Remove Parameters class.

Remove entityOwner from Parameters.

Move name out from Parameters class.

Move configuration to after the construction.

Simplify observers and endpoints.

Remove superfluous configureEntity overrides.

Add dependency on fest-swing-testng.

Use FEST for final print test.

Use FEST for more concise and readable assertions.

Divide test of F0Parser into multiple methods.

Migrate to TestNG

Minor change.

Change convention from LOGGER to log.

Fix reporting of errors during controls filling.

Bound maximal height of SliderControl?.

Minor improvements.

Improve tooltips for controls.

Also use Delimeted in more places.

Move static control utilities to Gui.

Rename package gui.components to controls.

Some cleaning in controls.

Improve Param classes placing.

Move ValueParam?, PrimitiveParam? and CompositeParam? one package up.

Improve ParamBuilder?.

Move getDef to ValueParam? and PrimitiveParam?.

Move getMax and getDef to ValueParam?.

Move getMin to ValueParam?.

Upgrade to laters apache commons versions.

Use filterInstanceof extensively.

Add instanceof filters.

Make ValueParam? in many places of Param.

Place assertions about ValueParam?.

Add ValueParam?

Rename ValueParam? to PrimitiveParam?

Minor changes.

Several improvements to params types.

Add NumberParam?.

Add TextControl? component.

Add .swp files to .gitignore

Greatly improved slider component.

Some improvements.

Make Param.reassign return also a state.

Add IterableIterator?.

Several changes.

  • Move util classes to better packages.
  • Remove warnings from eclim.

Several improvements.

Fix bug with BooleanParam?.

Some experiments with visualization.

Another fix to panel management.

Improve panel management.

Some refactorization around panels.

Add root class for panel.

File size: 6.1 KB
Line 
1package com.framsticks.model;
2
3import com.framsticks.params.FramsClass;
4import com.framsticks.util.math.Point3d;
5
6import java.util.ArrayList;
7import java.util.List;
8
9public class Creature {
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
95        /** pos_x, pos_y, pos_z*/
96        public double pos_x, pos_y, pos_z;
97
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; }
100
101        public double size_x, size_y, size_z;
102
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; }
105
106
107        /** center_x, center_y, center_z*/
108        public double center_x, center_y, center_z;
109
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; }
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
148        public final List<Part> getParts() { return parts; }
149        public final List<Joint> getJoints() { return joints; }
150        public final List<NeuroDef> getNeuroDefs() { return neurodefs; }
151
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>();
155
156        public final List<MechPart> getMechParts() { return mechparts; }
157        public final List<MechJoint> getMechJoints() { return mechjoints; }
158        public final List<Neuro> getNeurons() { return neurons; }
159
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}
Note: See TracBrowser for help on using the repository browser.