public void preprocess() {
		PatrolState s1 = new PatrolState();
		FollowState s2 = new FollowState();
		EatState s3 = new EatState();

		Transition s1tos2 = new Transition(s2) {
			@Override
			public boolean isValid(Agent a, Scene w) {
				for (Body b : w) {
					if ((b != a.body()) && (_targetFilter.filter(b))) {
						a.body().set(Properties.TARGET,b);
						return true;
					}
				}
				return false;
			}
		};

		Transition s2tos1 = new Transition(s1) {
			@Override
			public boolean isValid(Agent a, Scene w) {
				Body t = (Body)(a.body().get(Properties.TARGET));
				if ((t == null) || (!(w.contains(t)))) {
					return true;
				}
				return false;
			}
		};

		Transition s2tos3 = new Transition(s3) {
			@Override
			public boolean isValid(Agent a, Scene w) {
				// TODO not bounding rect
				if (w.getPartlyIn(a.body().boundingRect()).contains((Body)(a.body().get(Properties.TARGET)))) {
					return true;
				}
				return false;
			}
			
		};

		Transition s3tos1 = new Transition(s1) {
			@Override
			public boolean isValid(Agent a, Scene w) {
				Body t = (Body)(a.body().get(Properties.TARGET));
				return (t == null);
			}
		};

		Transition s3tos2 = new Transition(s2) {
			@Override
			public boolean isValid(Agent a, Scene w) {
				Body t = (Body)(a.body().get(Properties.TARGET));
				return ((t != null)
				    && (!(w.getPartlyIn(a.body()).contains(t))));
			}
		};

		s1.addTransition(s1tos2);
		s2.addTransition(s2tos1);
		s2.addTransition(s2tos3);
		s3.addTransition(s3tos1);
		s3.addTransition(s3tos2);

		this.setCurrent(s1);
	}