Once Every and chance combinations_fixed

The log generator agent (log_maker -- bridge shape) has the rule shown in the top image; whereas, the turtle generator agent (turtle_maker -- palm tree shape) has the rule shown in the lower image. The turtle_maker generates turtles regularly every 0.6 seconds with no variation; whereas, the log_maker generates logs with some degree of randomness. Why? Here it is important to understand how the AgentCubes simulation engine works. As has been noted earlier, AgentCubes continuously examines every agent in the world. Computers run very quickly – billions of cycles per second. This means that the AgentCubes simulation engine can examine all of the agents in a world many times per second. Now a little more on condition evaluation. In addition to examining an agent’s While Running rules in order from top to bottom, AgentCubes also examines the conditions within a rule from top to bottom. If a condition is satisfied, AgentCubes examines the next condition until it finds that all conditions are satisfied, in which case, the actions of the rule are performed, or until a condition fails to be true. In the latter case, AgentCubes moves on to examine the next rule in that agent or the next agent if there are no more rules. The important thing to remember is that, just as AgentCubes ignores all rules below one whose conditions are all true, AgentCubes ignores all conditions below one that is false. Let us first consider the first rule above (log_maker agent). What its conditions specify is that every 0.6 second, AgentCubes will then make a probability calculation (50%). This means that half the time, or about every other 0.6 second interval (assuming there is river on the right) a new log will be generated. Because it is probabilistic, sometimes there will be a log generated and sometimes there won’t. As with flipping coins, there may be several logs generated in a row or several “spaces” where no logs are generated. But in the long run, there will be logs generated on the average about once every 1.2 seconds, with some randomness. Now consider the second rule above (turtle_maker agent). It looks almost the same, but it is fundamentally different in its output. In this case, the probability calculation is being done first. How often does this happen? As noted above, the computer is running billions of instructions per second, which means AgentCubes is evaluating all the agents hundreds of times per second or more. If the probability is 50% it means that about half the time, this condition will be true. Once every 0.6 second the timer event will occur. Within a small fraction of a second, the probability event will become true, so that essentially every 0.6 second the agent will generate a turtle. Just as rule order is often critical, so, too, can condition order be important for proper agent behavior. The solution: simply switch the order of the timer and % chance conditions in the turtle_maker agent to match the order in the log_maker agent. Summary: Condition order within a rule can be critically important, just as can rule order within an agent’s behavior. This is particularly important when both timing and probability are used in the same rule. In general, the timing condition (“once every”) should precede the probability condition (“ % Chance”).
Data
Created:May 28, 2015
Played:110
Agent:12
Rules:29
Methods:14
false
Settings
New Project Name
Rename
Copy
Download
Show Project Report
Flag Project
Delete
The log generator agent (log_maker -- bridge shape) has the rule shown in the top image; whereas, the turtle generator agent (turtle_maker -- palm tree shape) has the rule shown in the lower image. The turtle_maker generates turtles regularly every 0.6 seconds with no variation; whereas, the log_maker generates logs with some degree of randomness. Why? Here it is important to understand how the AgentCubes simulation engine works. As has been noted earlier, AgentCubes continuously examines every agent in the world. Computers run very quickly – billions of cycles per second. This means that the AgentCubes simulation engine can examine all of the agents in a world many times per second. Now a little more on condition evaluation. In addition to examining an agent’s While Running rules in order from top to bottom, AgentCubes also examines the conditions within a rule from top to bottom. If a condition is satisfied, AgentCubes examines the next condition until it finds that all conditions are satisfied, in which case, the actions of the rule are performed, or until a condition fails to be true. In the latter case, AgentCubes moves on to examine the next rule in that agent or the next agent if there are no more rules. The important thing to remember is that, just as AgentCubes ignores all rules below one whose conditions are all true, AgentCubes ignores all conditions below one that is false. Let us first consider the first rule above (log_maker agent). What its conditions specify is that every 0.6 second, AgentCubes will then make a probability calculation (50%). This means that half the time, or about every other 0.6 second interval (assuming there is river on the right) a new log will be generated. Because it is probabilistic, sometimes there will be a log generated and sometimes there won’t. As with flipping coins, there may be several logs generated in a row or several “spaces” where no logs are generated. But in the long run, there will be logs generated on the average about once every 1.2 seconds, with some randomness. Now consider the second rule above (turtle_maker agent). It looks almost the same, but it is fundamentally different in its output. In this case, the probability calculation is being done first. How often does this happen? As noted above, the computer is running billions of instructions per second, which means AgentCubes is evaluating all the agents hundreds of times per second or more. If the probability is 50% it means that about half the time, this condition will be true. Once every 0.6 second the timer event will occur. Within a small fraction of a second, the probability event will become true, so that essentially every 0.6 second the agent will generate a turtle. Just as rule order is often critical, so, too, can condition order be important for proper agent behavior. The solution: simply switch the order of the timer and % chance conditions in the turtle_maker agent to match the order in the log_maker agent. Summary: Condition order within a rule can be critically important, just as can rule order within an agent’s behavior. This is particularly important when both timing and probability are used in the same rule. In general, the timing condition (“once every”) should precede the probability condition (“ % Chance”).
Edit Description
Design