01: package jaimoves.immun;
02:
03: import java.util.BitSet;
04: import java.util.Random;
05: import com.jme.math.Vector3f;
06:
07: public class ControlAntiGen extends AntiGenAbstract {
08:
09: private Vector3f wantedPos;
10: private float distance;
11: private int lastCalcAntigen;
12: private int bestCalcAntigen;
13:
14: // Vector3f deltaPos = new Vector3f();
15: // getLastPos().add(getCurrentPos().negate(),deltaPos);
16: // System.out.println("BLEEE " + deltaPos.toString());
17: // System.out.println(getCurrentPos().add(getLastPos().negate()));
18:
19: public ControlAntiGen(Vector3f wantedPos) {
20: this .wantedPos = wantedPos;
21: }
22:
23: public double calcDistance(AntiBody antibody, double range,
24: int problemSize) {
25: double ret = 1;
26: return ret;
27: }
28:
29: public void showAntigen() {
30: }
31:
32: public void updateProblem(Vector3f newPos) {
33: this .wantedPos = newPos;
34: distance = newPos.distance(wantedPos);
35: }
36:
37: public static void main(String[] args) {
38: ControlAntiGen blee = new ControlAntiGen(new Vector3f(0, 0, 0));
39: BitSet bits = new BitSet(64);
40: bits.flip(1);
41: bits.flip(2);
42: bits.flip(29);
43: AntiBody aaa = new AntiBody(bits);
44: int pattern[] = new int[3];
45: pattern[0] = 30;
46: pattern[1] = 30;
47: pattern[2] = 4;
48: double wynik[] = blee.patternParserAntiBody(aaa, pattern, true);
49: }
50:
51: public Vector3f getWantedPos() {
52: return wantedPos;
53: }
54: } // reprezentuje problem do rozwiazanie
|