Skip to content
Transfinity edited this page Sep 8, 2012 · 1 revision

Fish

The fish will store its position, rudder direction, and speed, and provide an interface for the AI to set the rudder direction and speed.

  • double rudderAngle
  • double speed - [0, 1] The speed of the fish.
  • static int newFishCost - The number of nutrients it costs to create a new fish in reproduction.
  • int gatheredNutrients - The number of gathered nutrients.
  • bool isAlive - Is the fish alive or dead?
  • static int maxSpeed - The maximum speed of the fish
  • int moves - The number of state moves this fish wants to travel. (keep thinking about this).

FishAI

The fish AI will be associated with a particular set of fish, and constantly be updating its rudder direction and speed by analyzing the state from Engine.getState().

  • implements Runnable
  • run() - constantly updating rudder direction and speed to obtain food
  • List<Fish> fish - A list of the fish this FishAI is in control of.
Clone this wiki locally