CattleAndDisease

Version 1 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: 6

Behaviors


AbattoirAbattoir

Number of methods: 0




CattleCattle

Number of methods: 12


WHEN-CREATING-NEW-AGENT ()

Procedure to initialize new calf with a random weight between 60 and 100 pounds, to establish the days sick to be 0 for an infected calf, and to establish various category counters

Number of rules: 2 

If
SEE ((0 0) , infectedcattle)
Then
SET (weight , to , 60+random(41.0)), and
SET (daysSick , to , 0), and
MAKE ((0 0) , countSIRM)

If
SEE-A ((0 0) , Cattle)
Then
SET (weight , to , 60+random(41.0)), and
MAKE ((0 0) , countSIRM)

ON (countSIR)

Procedure to update numSusceptible, numInfected, numRecovered, cumulativeInfected, and numCattle after addition of a new beef cow

Number of rules: 4 

If
SEE ((0 0) , cattle)
Then
SET (@numSusceptible , to , @numSusceptible + 1), and
SET (@numCattle , to , @numCattle + 1)

If
SEE ((0 0) , farm)
Then
SET (@numFarm , to , @numFarm+ 1)

If
SEE ((0 0) , infectedcattle)
Then
SET (@numInfected , to , @numInfected + 1), and
SET (@cumulativeInfected , to , @cumulativeInfected + 1), and
SET (@numCattle , to , @numCattle + 1)

If
SEE ((0 0) , recoveredcattle)
Then
SET (@numRecovered , to , @numRecovered + 1), and
SET (@numCattle , to , @numCattle + 1)

WHILE-RUNNING ()

Cattle Driver of Simulation

Number of rules: 7 

If
STACKED-A (immediately above , a , Farm), and
IS (weight , < , 600)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , inFarm)

If
STACKED-A (immediately above , a , Farm)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , farm2Sale)

If
IS (weight , < , 900), and
STACKED-A (somewhere above , a , Salebarn)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , inSaleBarn1)

If
STACKED-A (immediately above , a , Stocker)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , inStocker)

If
IS (weight , >= , 900), and
STACKED-A (somewhere above , a , Salebarn)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , inSaleBarn2)

If
STACKED-A (somewhere above , a , Feedlot)
Then
MAKE ((0 0) , sir), and
MAKE ((0 0) , inFeedlot)

If
STACKED-A (somewhere above , a , Abattoir)
Then
MAKE ((0 0) , sirAbattoir), and
MOVE ((0 1)), and
CHANGE ((0 0) , slaughtered)

ON (sir)

Procedure to advance an infected beef cow's illness, possibly to recovery, and determine if a susceptible cattle agent becomes sick

Number of rules: 3 

If
SEE ((0 0) , infectedcattle), and
IS (daysSick , > , @INFECTIOUS_PERIOD)
Then
CHANGE ((0 0) , recoveredcattle), and
SET (daysSick , to , 0), and
SET (@numInfected , to , @numInfected - 1), and
SET (@numRecovered , to , @numRecovered + 1)

If
SEE ((0 0) , infectedcattle)
Then
SET (daysSick , to , daysSick + 0.25)

If
SEE ((0 0) , cattle), and
NEXT-TO (>= , 1 , infectedcattle), and
%-CHANCE (@INFECTION_PROBABILITY * 100)
Then
CHANGE ((0 0) , infectedcattle), and
SET (@numSusceptible , to , @numSusceptible - 1), and
SET (@numInfected , to , @numInfected + 1), and
SET (@cumulativeInfected , to , @cumulativeInfected + 1), and
SET (daysSick , to , 0)

ON (inFarm)

Cattle agent's behavior on a Farm tile

Number of rules: 1 

If
no condition
Then
MOVE-RANDOM-ON (farm), and
SET (weight , to , weight + 0.5 + random(0.25))

ON (farm2Sale)

Cattle agent's behavior in moving from Farm tiles to SaleBarn tiles

Number of rules: 6 

If
SEE ((1 0) , farm)
Then
MOVE ((1 0))

If
SEE ((1 0) , pointleft)
Then
MOVE ((1 -1))

If
SEE ((0 -1) , pointleft)
Then
MOVE ((0 -1))

If
SEE ((1 0) , pointright)
Then
MOVE ((1 1))

If
SEE ((0 1) , pointright)
Then
MOVE ((0 1))

If
SEE ((1 0) , salebarn)
Then
MOVE ((1 0)), and
SET (time1InSale , to , 1 + random(5))

ON (inSaleBarn1)

Cattle agent's behavior when in sale barn for the first time

Number of rules: 2 

If
IS (time1InSale , > , 8)
Then
MOVE ((0 -1))

If
no condition
Then
SET (time1InSale , to , time1InSale + 1), and
MAKE ((0 0) , moveInSaleBarn)

ON (moveInSaleBarn)

Procedure for a cattle agent's random movement in a sale barn

Number of rules: 4 

If
NEXT-TO (> , 0 , salebarn)
Then
MOVE-RANDOM-ON (salebarn)

If
NEXT-TO (> , 0 , cattle)
Then
MOVE-RANDOM-ON (cattle)

If
NEXT-TO (> , 0 , infectedcattle)
Then
MOVE-RANDOM-ON (infectedcattle)

If
NEXT-TO (> , 0 , recoveredcattle)
Then
MOVE-RANDOM-ON (recoveredcattle)

ON (inStocker)

Procedure for a cattle agent's behavior in stocker

Number of rules: 3 

If
IS (weight , >= , 900), and
SEE ((0 1) , stocker)
Then
MOVE ((0 1))

If
IS (weight , >= , 900), and
SEE ((0 1) , salebarn)
Then
MOVE ((0 1)), and
SET (time2InSale , to , 1 + random(5))

If
no condition
Then
MOVE-RANDOM-ON (stocker), and
SET (weight , to , weight + 0.4 + random(0.2))

ON (inSaleBarn2)

Cattle agent's behavior when in sale barn for the second time

Number of rules: 2 

If
IS (time2InSale , > , 8)
Then
MOVE ((0 1))

If
no condition
Then
SET (time2InSale , to , time2InSale + 1), and
MAKE ((0 0) , moveInSaleBarn)

ON (inFeedlot)

Procedure for a cattle agent's behavior in feedlot

Number of rules: 5 

If
IS (weight , >= , 1300)
Then
MOVE ((0 1))

If
SEE ((0 1) , feedlot)
Then
MOVE ((0 1)), and
SET (weight , to , weight + 0.5 + random(0.5))

If
SEE ((-1 0) , feedlot)
Then
MOVE ((-1 0)), and
SET (weight , to , weight + 0.5 + random(0.5))

If
SEE ((1 0) , feedlot)
Then
MOVE ((1 0)), and
SET (weight , to , weight + 0.5 + random(0.5))

If
no condition
Then
SET (weight , to , weight + 0.5 + random(0.5))

ON (sirAbattoir)

Procedure to adjust appropriate system variables when a beef cow is slaughtered

Number of rules: 3 

If
SEE ((0 0) , cattle)
Then
SET (@numSusceptible , to , @numSusceptible - 1)

If
SEE ((0 0) , infectedcattle)
Then
SET (@numInfected , to , @numInfected - 1)

If
SEE ((0 0) , recoveredcattle)
Then
SET (@numRecovered , to , @numRecovered - 1)



FarmFarm

Number of methods: 1


WHEN-CREATING-NEW-AGENT ()

Procedure to initialize a Farm agent possibly to have a Cattle agent on top

Number of rules: 1 

If
SEE ((0 0) , farm), and
%-CHANCE (@INIT_CATTLE_PROBABILITY*100)
Then
NEW ((0 0) , cattle)



FeedlotFeedlot

Number of methods: 0




SalebarnSalebarn

Number of methods: 0




StockerStocker

Number of methods: 0



This report was generated using AgentSheets Version 4.0.0