Version 2 of an agent-based program modeling the spread of a non-fatal disease in beef cattle (Copyright 2013). The program accompanies Module 12.2, "Agents of Interaction: Steering a Dangerous Course," from textbook "Introduction to Computational Science: Modeling and Simulation for the Sciences," 2nd ed., by Angela B. Shiflet and George W. Shiflet, Princeton University Press.
Agents
Number of agents: 7
Behaviors
Abattoir
Number of methods: 0
Cattle
Number of methods: 13
Number of rules: 2
If
SEE (
,
)
Then
SET (weight , to , 60+random(41.0)), and
SET (daysSick , to , 0), and
MAKE (
, countSIRM)
If
SEE-A (
, Cattle)
Then
SET (weight , to , 60+random(41.0)), and
MAKE (
, countSIRM)
Number of rules: 4
If
SEE (
,
)
Then
SET (@numS , to , @numS + 1), and
SET (@numCattle , to , @numCattle + 1)
If
SEE (
,
)
Then
SET (@numI , to , @numI + 1), and
SET (@cummulativeI , to , @cummulativeI + 1), and
SET (@numCattle , to , @numCattle + 1)
If
SEE (
,
)
Then
SET (@numR , to , @numR + 1), and
SET (@numCattle , to , @numCattle + 1)
If
SEE (
,
)
Then
SET (@numM , to , @numM + 1), and
SET (@numCattle , to , @numCattle + 1)
Number of rules: 1
If
SEE (
,
), and
IS (@numS , = , @numCattle), and
%-CHANCE (100/@numCattle)
Then
CHANGE (
,
), and
SET (@numS , to , @numS - 1), and
SET (@numI , to , 1), and
SET (@cummulativeI , to , 1)
Number of rules: 7
If
STACKED-A (immediately above , a , Farm), and
IS (weight , < , 600)
Then
MAKE (
, sir), and
MAKE (
, inFarm)
If
STACKED-A (immediately above , a , Farm)
Then
MAKE (
, sir), and
MAKE (
, farm2Sale)
If
IS (weight , < , 900), and
STACKED-A (somewhere above , a , Salebarn)
Then
MAKE (
, sir), and
MAKE (
, inSaleBarn1)
If
STACKED-A (immediately above , a , Stocker)
Then
MAKE (
, sir), and
MAKE (
, inStocker)
If
IS (weight , >= , 900), and
STACKED-A (somewhere above , a , Salebarn)
Then
MAKE (
, sir), and
MAKE (
, inSaleBarn2)
If
STACKED-A (somewhere above , a , Feedlot)
Then
MAKE (
, sir), and
MAKE (
, inFeedlot)
If
STACKED-A (somewhere above , a , Abattoir)
Then
MOVE (
), and
MAKE (
, sirAbattoir), and
CHANGE (
,
)
Number of rules: 1
If
no condition
Then
MOVE-RANDOM-ON (
), and
SET (weight , to , weight + 0.5 + random(0.25))
Number of rules: 2
If
IS (time1InSale , > , 8)
Then
MOVE (
)
If
no condition
Then
SET (time1InSale , to , time1InSale + 1), and
MAKE (
, moveInSaleBarn)
Number of rules: 5
If
NEXT-TO (> , 0 ,
)
Then
MOVE-RANDOM-ON (
)
If
NEXT-TO (> , 0 ,
)
Then
MOVE-RANDOM-ON (
)
If
NEXT-TO (> , 0 ,
)
Then
MOVE-RANDOM-ON (
)
If
NEXT-TO (> , 0 ,
)
Then
MOVE-RANDOM-ON (
)
If
NEXT-TO (> , 0 ,
)
Then
MOVE-RANDOM-ON (
)
Number of rules: 3
If
IS (weight , >= , 900), and
SEE (
,
)
Then
MOVE (
)
If
IS (weight , >= , 900), and
SEE (
,
)
Then
MOVE (
), and
SET (time2InSale , to , 1 + random(5))
If
no condition
Then
MOVE-RANDOM-ON (
), and
SET (weight , to , weight + 0.4 + random(0.2))
Number of rules: 2
If
IS (time2InSale , > , 8)
Then
MOVE (
)
If
no condition
Then
SET (time2InSale , to , time2InSale + 1), and
MAKE (
, moveInSaleBarn)
Number of rules: 5
If
IS (weight , >= , 1300)
Then
MOVE (
)
If
SEE (
,
)
Then
MOVE (
), and
SET (weight , to , weight + 0.7 + random(0.1))
If
SEE (
,
)
Then
MOVE (
), and
SET (weight , to , weight + 0.5 + random(0.5))
If
SEE (
,
)
Then
MOVE (
), and
SET (weight , to , weight + 0.5 + random(0.5))
If
no condition
Then
SET (weight , to , weight + 0.5 + random(0.5))
Number of rules: 3
If
SEE (
,
), and
IS (daysSick , > , @INFECTIOUS_PERIOD)
Then
CHANGE (
,
), and
SET (daysSick , to , 0), and
SET (@numI , to , @numI - 1), and
SET (@numR , to , @numR + 1)
If
SEE (
,
)
Then
SET (daysSick , to , daysSick + 0.25)
If
SEE (
,
), and
NEXT-TO (>= , 1 ,
), and
%-CHANCE (@INFECTION_PROBABILITY * 100)
Then
CHANGE (
,
), and
SET (@numS , to , @numS - 1), and
SET (@numI , to , @numI + 1), and
SET (@cummulativeI , to , @cummulativeI + 1), and
SET (daysSick , to , 0)
Number of rules: 4
If
SEE (
,
)
Then
SET (@numS , to , @numS - 1)
If
SEE (
,
)
Then
SET (@numI , to , @numI - 1)
If
SEE (
,
)
Then
SET (@numR , to , @numR - 1)
If
SEE (
,
)
Then
SET (@numM , to , @numM - 1)
Farm
Number of methods: 1
Feedlot
Number of methods: 0
Salebarn
Number of methods: 0
Simulationdriver
Number of methods: 1
Number of rules: 4
If
IS (phase , = , 0)
Then
BROADCAST (Farm , randomCattle), and
SET (phase , to , 1)
If
IS (phase , = , 1), and
IS (@numI , = , 0)
Then
BROADCAST (Cattle , initI)
If
IS (phase , = , 1)
Then
SET (phase , to , 2)
If
IS (phase , = , 2)
Then
BROADCAST (Cattle , cattleBehave)
Stocker
Number of methods: 0
This report was generated using AgentSheets Version 4.0.0
