Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Calendar
Upcoming eventsCookbook |
EnergyHow can I simulate an agent gaining and losing energy? Solution:
Agent Variables can be added to agents to give them additional awareness about themselves. A common variable is Energy. Agent Variables are blue. When an Agent Variable is created, it must go into the column of the breed that will have the variable and be given an identifying name. Agent Variables will then be found in the My Blocks column, in the drawer of the breed in which it was created. These Agent Variables can then become part of the code where needed. In this example, the Agent Number Variable was used to create the Energy Variable. Inc Energy- is translated as ‘increment energy.’ Increment energy can be either by a positive or a negative amount. Often a number block is fit in next to the variable block. Energy is used in Fish and Plankton. When a fish collides with a plankton it increases it's energy, and as it moves it loses energy:
Submitted by paige on 29. December 2007 - 17:55
|
Login (optional)Navigation |