From VisualWorks® NonCommercial, 7.6 of lundi 3 mars 2008 on mardi 5 juillet 2011 at 7:03:15
SimPolillaSimiatug_v02
CormasNS.Models
false
private Smalltalk.*
private CormasNS.Kernel.*
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
Ag_Isolate_12
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_12 init
init
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_12 control
Ag_Isolate_012_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_12_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_12_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_12_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_12_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_12_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_12 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil: [penality := 3]
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_12 pov
pov
^#Ag_Isolate_12
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_12 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 12.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 12.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_17
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_17 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_17 control
Ag_Isolate_017_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_17_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_17_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_17_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_17_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_17_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_17 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_17 pov
pov
^#Ag_Isolate_17
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_17 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 17.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage := self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 17.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
AgriTest01
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
niveauFormation
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 class accessing
niveauFormation
"Getter accessor with default value = 1 "
^niveauFormation ifNil:[niveauFormation := 1]
niveauFormation: anObject
niveauFormation := anObject
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 control
step
"En el campo :
move fumigar ponerPapasMasProfundo "
self move.
self fumigar.
self ponerPapasMasProfundo.
"En la bodega :
fumigarBodega limpiar verificarPolillaYBotar verificarPolillaYDestruir "
self patch bodega=1 ifTrue:[
self fumigarBodega.
self limpiar.
self verificarPolillaYBotar.
self verificarPolillaYDestruir.
].
"En el mercado/pueblo :
comprarSemillas comprarSemillasVerificar venderPapas venderPapasSanas"
self patch population>0 ifTrue:[
].
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 alCampo
fumigar
|eficacidadTratamientoChimico seuil|
"Aqui se entran las caracteristicas del campesino"
eficacidadTratamientoChimico:=0.5.
seuil:=100/self class niveauFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*eficacidadTratamientoChimico].
self patch phthorimaea>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*eficacidadTratamientoChimico].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*eficacidadTratamientoChimico].
move
self randomWalkConstrainedBy: [:c | c noOccupant].
moveAndThink
| teciaNeighbours |
teciaNeighbours := self patch neighbourhood select: [:c | c patch = self patch bufferNumberTeciaFemale].
teciaNeighbours isEmpty
ifTrue: [self randomWalk]
ifFalse: [self leave.
self moveTo: (Cormas selectRandomlyFrom: teciaNeighbours)].
(self perception:15).
ponerPapasMasProfundo
|eficacidadTecnica|
eficacidadTecnica:=0.2.
self patch tecia: self patch tecia*eficacidadTecnica.
self patch phthorimaea: self patch phthorimaea*eficacidadTecnica.
self patch symmetrischemma: self patch symmetrischemma*eficacidadTecnica.
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 pov
pov
^#AgriTest01.
CormasNS.Models.SimPolillaSimiatug_v02.AgriTest01 alAlmacen
fumigarBodega
limpiar
"verificarPolillaYBotar verificarPolillaYDestruir"
verificarPolillaYBotar
"verificarPolillaYDestruir"
verificarPolillaYDestruir
Ag_Isolate_18
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_18 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_18 control
Ag_Isolate_018_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_18_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_18_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_18_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_18_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_18_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_18 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_18 pov
pov
^#Ag_Isolate_18
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_18 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: 1.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 18.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage := self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 18.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
| eficacidadTratamientoChimico seuil |
eficacidadTratamientoChimico := self nivelFormation * 0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation = 0
ifFalse: [seuil := 100 / self nivelFormation]
ifTrue: [seuil := 100].
self patch tecia > seuil
ifTrue:
[self patch tecia: self patch tecia * (1 - eficacidadTratamientoChimico)]
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
AggregateTecia
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.SpatialEntityAggregate
false
none
agreTec
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.AggregateTecia init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.AggregateTecia pov
pov
^self size > self agreTec
ifTrue: [#needHelp]
ifFalse: [#noHelpNeeded]
CormasNS.Models.SimPolillaSimiatug_v02.AggregateTecia accessing
agreTec
^agreTec ifNil:[agreTec := 10]
agreTec: anObject
agreTec := anObject
Aggregate
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.SpatialEntityAggregate
false
none
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Aggregate init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Aggregate pov
pov
^self size > 10
ifTrue: [#needHelp]
ifFalse: [#noHelpNeeded]
MsgTecia
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.Msg
false
none
location
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.MsgTecia accessing
location
^location
location: anObject
location := anObject
AggregateSymmetrischema
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.SpatialEntityAggregate
false
none
agreSym
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.AggregateSymmetrischema init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.AggregateSymmetrischema accessing
agreSym
^agreSym ifNil:[agreSym := 10]
agreSym: anObject
agreSym := anObject
CormasNS.Models.SimPolillaSimiatug_v02.AggregateSymmetrischema pov
pov
^self size > self agreSym
ifTrue: [#needHelp]
ifFalse: [#noHelpNeeded]
Ag_Isolate_08
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_08 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_08 control
Ag_Isolate_08_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_08_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_08_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_08_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_08_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_08_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_08 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_08 pov
pov
^#Ag_Isolate_08
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_08 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 8.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre |
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 8.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.CormasModel
false
none
theCells theAgriTest01s theAgri01s theAgri02s theAgri03s theAgri04s theAgri05s theAggregates theAggregateTecias theAggregatePhthorimaeas theAggregateSymmetrischemas theAg_Isolate_01s theAg_Isolate_02s theAg_Isolate_03s theAg_Isolate_04s theAg_Isolate_05s theAg_Isolate_06s theAg_Isolate_07s theAg_Isolate_08s theAg_Isolate_09s theAg_Isolate_10s theAg_Isolate_11s theAg_Isolate_12s theAg_Isolate_13s theAg_Isolate_14s theAg_Isolate_15s theAg_Isolate_16s theAg_Isolate_17s theAg_Isolate_18s decalage
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 class description
authors
^ 'François Rebaudo
Olivier Dangles
'
comments
^ 'IRD-McKnight-PUCE-INIAP
Density dependent dispersion model of the threee invasive tuber moth species in the tropical Andes (Ecuador - Bolivar - Simiatug) : Tecia solanivora, Phthorimaea operculella and symmetrischemma tangolias.
This study received financial support from the McKnight fundation.'
creationDate
^ '8 nov 2007'
emails
^ 'rebaudo@gmail.com
'
lastUpdate
^ 'mardi 5 juillet 2011'
version
^ 'rebaudo_plos_comp_biol.st'
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 init
load_SMA_isolate
"ES = Para cargar los distintas capas que vienen de los SIG"
"US = To upload the different layers from GIS into the model"
self spaceModel loadEnvironmentFromFile: 'SMA-ind-tempPromedio.env' withPov:#povPTMteciaFemale.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-agro.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-village.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-village2.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-population.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-TECIA.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-TECIA2.env'.
"ES = Para cortar el mapa en cuadros que representan las comunidades"
"US = To seperate the landscape into communities representing villages at different elevations"
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-agroPart.env'.
self spaceModel addEnvironmentDataFromFile: 'SMA-ind-agroPartPart.env'.
self initCells.
self initAgentsIsolate.
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 accessing
decalage
^decalage ifNil:[decalage:= 0].
decalage: anObject
decalage := anObject
theAggregatePhthorimaeas
^theAggregatePhthorimaeas ifNil:[theAggregatePhthorimaeas := IndexedSet new]
theAggregatePhthorimaeas: x
theAggregatePhthorimaeas := x
theAggregates
^theAggregates ifNil:[theAggregates := IndexedSet new]
theAggregates: x
theAggregates := x
theAggregateSymmetrischemas
^theAggregateSymmetrischemas ifNil:[theAggregateSymmetrischemas := IndexedSet new]
theAggregateSymmetrischemas: x
theAggregateSymmetrischemas := x
theAggregateTecias
^theAggregateTecias ifNil:[theAggregateTecias := IndexedSet new]
theAggregateTecias: x
theAggregateTecias := x
theAgri01s
^theAgri01s ifNil:[theAgri01s := IndexedSet new]
theAgri01s: x
theAgri01s := x
theAgri02s
^theAgri02s ifNil:[theAgri02s := IndexedSet new]
theAgri02s: x
theAgri02s := x
theAgri03s
^theAgri03s ifNil:[theAgri03s := IndexedSet new]
theAgri03s: x
theAgri03s := x
theAgri04s
^theAgri04s ifNil:[theAgri04s := IndexedSet new]
theAgri04s: x
theAgri04s := x
theAgri05s
^theAgri05s ifNil:[theAgri05s := IndexedSet new]
theAgri05s: x
theAgri05s := x
theAgriTest01s
^theAgriTest01s ifNil:[theAgriTest01s := IndexedSet new]
theAgriTest01s: x
theAgriTest01s := x
theAg_Isolate_01s
^theAg_Isolate_01s ifNil:[theAg_Isolate_01s := IndexedSet new]
theAg_Isolate_01s: x
theAg_Isolate_01s := x
theAg_Isolate_02s
^theAg_Isolate_02s ifNil:[theAg_Isolate_02s := IndexedSet new]
theAg_Isolate_02s: x
theAg_Isolate_02s := x
theAg_Isolate_03s
^theAg_Isolate_03s ifNil:[theAg_Isolate_03s := IndexedSet new]
theAg_Isolate_03s: x
theAg_Isolate_03s := x
theAg_Isolate_04s
^theAg_Isolate_04s ifNil:[theAg_Isolate_04s := IndexedSet new]
theAg_Isolate_04s: x
theAg_Isolate_04s := x
theAg_Isolate_05s
^theAg_Isolate_05s ifNil:[theAg_Isolate_05s := IndexedSet new]
theAg_Isolate_05s: x
theAg_Isolate_05s := x
theAg_Isolate_06s
^theAg_Isolate_06s ifNil:[theAg_Isolate_06s := IndexedSet new]
theAg_Isolate_06s: x
theAg_Isolate_06s := x
theAg_Isolate_07s
^theAg_Isolate_07s ifNil:[theAg_Isolate_07s := IndexedSet new]
theAg_Isolate_07s: x
theAg_Isolate_07s := x
theAg_Isolate_08s
^theAg_Isolate_08s ifNil:[theAg_Isolate_08s := IndexedSet new]
theAg_Isolate_08s: x
theAg_Isolate_08s := x
theAg_Isolate_09s
^theAg_Isolate_09s ifNil:[theAg_Isolate_09s := IndexedSet new]
theAg_Isolate_09s: x
theAg_Isolate_09s := x
theAg_Isolate_10s
^theAg_Isolate_10s ifNil:[theAg_Isolate_10s := IndexedSet new]
theAg_Isolate_10s: x
theAg_Isolate_10s := x
theAg_Isolate_11s
^theAg_Isolate_11s ifNil:[theAg_Isolate_11s := IndexedSet new]
theAg_Isolate_11s: x
theAg_Isolate_11s := x
theAg_Isolate_12s
^theAg_Isolate_12s ifNil:[theAg_Isolate_12s := IndexedSet new]
theAg_Isolate_12s: x
theAg_Isolate_12s := x
theAg_Isolate_13s
^theAg_Isolate_13s ifNil:[theAg_Isolate_13s := IndexedSet new]
theAg_Isolate_13s: x
theAg_Isolate_13s := x
theAg_Isolate_14s
^theAg_Isolate_14s ifNil:[theAg_Isolate_14s := IndexedSet new]
theAg_Isolate_14s: x
theAg_Isolate_14s := x
theAg_Isolate_15s
^theAg_Isolate_15s ifNil:[theAg_Isolate_15s := IndexedSet new]
theAg_Isolate_15s: x
theAg_Isolate_15s := x
theAg_Isolate_16s
^theAg_Isolate_16s ifNil:[theAg_Isolate_16s := IndexedSet new]
theAg_Isolate_16s: x
theAg_Isolate_16s := x
theAg_Isolate_17s
^theAg_Isolate_17s ifNil:[theAg_Isolate_17s := IndexedSet new]
theAg_Isolate_17s: x
theAg_Isolate_17s := x
theAg_Isolate_18s
^theAg_Isolate_18s ifNil:[theAg_Isolate_18s := IndexedSet new]
theAg_Isolate_18s: x
theAg_Isolate_18s := x
theCells: x
theCells := x
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 probes
aa
|env rec|
env:=self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsRcp].
rec:=self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsTrt].
^env-rec
aaa
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsTrt]
aaaa
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsRcp]
agroPartPart_1
|com3 i|
i:=1.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_11
|com3 i|
i:=7.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_12
|com3 i|
i:=8.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_13
|com3 i|
i:=9.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_14
|com3 i|
i:=10.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_15
|com3 i|
i:=11.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_16
|com3 i|
i:=12.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_2
|com3 i|
i:=2.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_21
|com3 i|
i:=13.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_22
|com3 i|
i:=14.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_23
|com3 i|
i:=15.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_24
|com3 i|
i:=16.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_25
|com3 i|
i:=17.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_26
|com3 i|
i:=18.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_3
|com3 i|
i:=3.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_4
|com3 i|
i:=4.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_5
|com3 i|
i:=5.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPartPart_6
|com3 i|
i:=6.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ]).
^(com3) size /6
agroPart_1
|com1 com2 com3 i|
i:=1.
com1:= (self theCells select: [:g | g agroPart==i]).
com2:= (self theCells select: [:f | f bufferNumberTeciaFemale>1]).
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPart==i] ]).
^(com3) size /36
agroPart_2
|com3 i|
i:=2.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPart==i] ]).
^(com3) size /36
agroPart_3
|com3 i|
i:=3.
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPart==i] ]).
^(com3) size /36
difTempSP
|pro sto|
pro:=self theCells inject: 0 into: [:i :j | i +j tempStochastic].
sto:=self theCells inject: 0 into: [:i :j | i +j tempPromedio].
^sto - pro
mailRECUS
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsRcp]
mailRECU_TRT
|env rec|
env:=self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsRcp].
rec:=self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsTrt].
^env-rec
mailTRT
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nbrMailsTrt]
NBRmailSent
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f mailSent]
NBRmailSentRsp
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f mailSentRsp]
nivel_is_01
^self theAg_Isolate_01s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_02
^self theAg_Isolate_02s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_03
^self theAg_Isolate_03s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_04
^self theAg_Isolate_04s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_05
^self theAg_Isolate_05s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_06
^self theAg_Isolate_06s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_07
^self theAg_Isolate_07s inject:0 into:[:tot :f | tot + f nivelFormation]
nivel_is_08
^self theAg_Isolate_08s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_09
^self theAg_Isolate_09s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_10
^self theAg_Isolate_10s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_11
^self theAg_Isolate_11s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_12
^self theAg_Isolate_12s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_13
^self theAg_Isolate_13s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_14
^self theAg_Isolate_14s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_15
^self theAg_Isolate_15s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_16
^self theAg_Isolate_16s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_17
^self theAg_Isolate_17s inject: 0 into: [:tot :f | tot + f nivelFormation]
nivel_is_18
^self theAg_Isolate_18s inject: 0 into: [:tot :f | tot + f nivelFormation]
PH
^self theCells inject: 0 into: [:i :j | i + j bufferNumberPhthorimaeaFemale].
PHnumber1
^(self theCells select: [:f | f bufferNumberPhthorimaeaFemale>1])size.
PHnumber100
^(self theCells select: [:f | f bufferNumberPhthorimaeaFemale>100])size.
PHnumber200
^(self theCells select: [:f | f bufferNumberPhthorimaeaFemale>200])size.
prix_helped
|com1 com10 com100 comClean i j prix prixG prixG1 prixG2 prixG4 prixG5 prixG6 class1 class2 class3 class4|
prixG:=0.
class1:=1.
class2:=0.8.
class3:=0.5.
class4:=0.2.
j:=(Cormas randomFrom:1 to:96).
prix:=Set new.
prix := #(94 137 234 255 247 221 201 203 271 274 629 300 228 342 331 238 200 142 100 81 83 100 116 182 206 167 229 189 149 134 130 138 190 229 290 346 340 311 221 255 172 151 185 187 177 198 204 220 221 204 181 199 154 181 177 200 213 185 159 138 134 137 142 150 169 159 207 242 298 282 225 228 266 310 342 354 360 258 367 342 303 231 151 152 179 238 303 315 300 243 263 170 139 118 135 136 188 175 188 230 227 204 180 175).
i:=1.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
prixG1:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
i:=2.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
prixG2:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
i:=4.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
prixG4:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
i:=5.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
prixG5:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
i:=6.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
prixG6:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
prixG:=(prixG1+prixG2+prixG4+prixG5+prixG6)/5.
^prixG
prix_helper
|com1 com10 com100 comClean i j prix prixG class1 class2 class3 class4|
prixG:=0.
i:=3.
class1:=1.
class2:=0.8.
class3:=0.5.
class4:=0.2.
com100:=1-((self theCells select: [:f | f bufferNumberTeciaFemale>100 and: [f agroPartPart==i] ])size /6).
com10:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>10 and: [f agroPartPart==i] ])size /6)-com100).
com1:=1-(((self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPartPart==i] ])size /6)-com100 -com10).
comClean:=1-((self theCells select: [:f | f bufferNumberTeciaFemale=0 and: [f agroPartPart==i] ])size /6).
j:=(Cormas randomFrom:1 to:96).
prix:=Set new.
prix := #(94 137 234 255 247 221 201 203 271 274 629 300 228 342 331 238 200 142 100 81 83 100 116 182 206 167 229 189 149 134 130 138 190 229 290 346 340 311 221 255 172 151 185 187 177 198 204 220 221 204 181 199 154 181 177 200 213 185 159 138 134 137 142 150 169 159 207 242 298 282 225 228 266 310 342 354 360 258 367 342 303 231 151 152 179 238 303 315 300 243 263 170 139 118 135 136 188 175 188 230 227 204 180 175).
prixG:= ((prix at:j) *comClean*class1) + ((prix at:j) *com1*class2) + ((prix at:j) *com10*class3) + ((prix at:j) *com100*class4) .
^prixG
prix_ref
| j prix prixG |
prixG:=0.
j:=(Cormas randomFrom:1 to:96).
prix:=Set new.
prix := #(94 137 234 255 247 221 201 203 271 274 629 300 228 342 331 238 200 142 100 81 83 100 116 182 206 167 229 189 149 134 130 138 190 229 290 346 340 311 221 255 172 151 185 187 177 198 204 220 221 204 181 199 154 181 177 200 213 185 159 138 134 137 142 150 169 159 207 242 298 282 225 228 266 310 342 354 360 258 367 342 303 231 151 152 179 238 303 315 300 243 263 170 139 118 135 136 188 175 188 230 227 204 180 175).
prixG:= ((prix at:j) *6) .
^prixG
qualityHabitat
^self theCells inject: 0 into: [:i :j | i/44 + j qualityHabitat].
SMA_PH_nbr1_com1
|com1 com2 com3|
com1:= (self theCells select: [:g | g agroPart==1]).
com2:= (self theCells select: [:f | f bufferNumberTeciaFemale>1]).
com3:=(self theCells select: [:f | f bufferNumberTeciaFemale>1 and: [f agroPart==1] ]).
^(com3) size
SY
^self theCells inject: 0 into: [:i :j | i + j bufferNumberSymmetrischemaFemale].
SYnumber1
^(self theCells select: [:f | f bufferNumberSymmetrischemaFemale>1])size.
SYnumber100
^(self theCells select: [:f | f bufferNumberSymmetrischemaFemale>100])size.
SYnumber200
^(self theCells select: [:f | f bufferNumberSymmetrischemaFemale>200])size.
TE
^self theCells inject: 0 into: [:i :j | i + j bufferNumberTeciaFemale].
TempStochastic
^self theCells inject: 0 into: [:i :j | i/80 +j tempStochastic]
TEnumber1
^(self theCells select: [:f | f bufferNumberTeciaFemale>1])size.
TEnumber100
^(self theCells select: [:f | f bufferNumberTeciaFemale>100])size.
TEnumber200
^(self theCells select: [:f | f bufferNumberTeciaFemale>200])size.
theCells
^theCells ifNil:[theCells := IndexedSet new]
ZProbe
^self theCells inject: 0 into: [:i :j | i + j probe].
ZstoPec
^self theCells inject: 0 into: [:i :j | i + j stoPec].
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 control
stepSMA_isolate: t
super stepEntities: self theCells.
self initAggregates.
self initAggregatesTecia.
"NON STAGE DEPENDENT---------------------------------------------------"
self theESE do: [:aCell | aCell initVariablesIsolate].
self theESE do: [:aCell | aCell constructAgroPart].
self theESE do: [:aCell | aCell updateTempStochastic].
self theESE do: [:aCell | aCell updateQualityHabitat].
"AGENT DEPENDENT-----------------------------------------------------------"
self theAg_Isolate_01s do: [:fm | fm Ag_Isolate_01_sendMsgHelp].
self theAg_Isolate_02s do: [:fm | fm Ag_Isolate_02_sendMsgHelp].
self theAg_Isolate_03s do: [:fm | fm Ag_Isolate_03_sendMsgHelp].
self theAg_Isolate_04s do: [:fm | fm Ag_Isolate_04_sendMsgHelp].
self theAg_Isolate_05s do: [:fm | fm Ag_Isolate_05_sendMsgHelp].
self theAg_Isolate_06s do: [:fm | fm Ag_Isolate_06_sendMsgHelp].
self theAg_Isolate_01s do: [:fm | fm Ag_Isolate_01_readMsgHelpAndAnswer].
self theAg_Isolate_02s do: [:fm | fm Ag_Isolate_02_readMsgHelpAndAnswer].
self theAg_Isolate_03s do: [:fm | fm Ag_Isolate_03_readMsgHelpAndAnswer].
self theAg_Isolate_04s do: [:fm | fm Ag_Isolate_04_readMsgHelpAndAnswer].
self theAg_Isolate_05s do: [:fm | fm Ag_Isolate_05_readMsgHelpAndAnswer].
self theAg_Isolate_06s do: [:fm | fm Ag_Isolate_06_readMsgHelpAndAnswer].
self theAg_Isolate_01s do: [:fm | fm Ag_Isolate_01_readAnswer].
self theAg_Isolate_02s do: [:fm | fm Ag_Isolate_02_readAnswer].
self theAg_Isolate_03s do: [:fm | fm Ag_Isolate_03_readAnswer].
self theAg_Isolate_04s do: [:fm | fm Ag_Isolate_04_readAnswer].
self theAg_Isolate_05s do: [:fm | fm Ag_Isolate_05_readAnswer].
self theAg_Isolate_06s do: [:fm | fm Ag_Isolate_06_readAnswer].
self theAg_Isolate_07s do: [:fm | fm Ag_Isolate_07_sendMsgHelp].
self theAg_Isolate_08s do: [:fm | fm Ag_Isolate_08_sendMsgHelp].
self theAg_Isolate_09s do: [:fm | fm Ag_Isolate_09_sendMsgHelp].
self theAg_Isolate_10s do: [:fm | fm Ag_Isolate_10_sendMsgHelp].
self theAg_Isolate_11s do: [:fm | fm Ag_Isolate_11_sendMsgHelp].
self theAg_Isolate_12s do: [:fm | fm Ag_Isolate_12_sendMsgHelp].
self theAg_Isolate_07s do: [:fm | fm Ag_Isolate_07_readMsgHelpAndAnswer].
self theAg_Isolate_08s do: [:fm | fm Ag_Isolate_08_readMsgHelpAndAnswer].
self theAg_Isolate_09s do: [:fm | fm Ag_Isolate_09_readMsgHelpAndAnswer].
self theAg_Isolate_10s do: [:fm | fm Ag_Isolate_10_readMsgHelpAndAnswer].
self theAg_Isolate_11s do: [:fm | fm Ag_Isolate_11_readMsgHelpAndAnswer].
self theAg_Isolate_12s do: [:fm | fm Ag_Isolate_12_readMsgHelpAndAnswer].
self theAg_Isolate_07s do: [:fm | fm Ag_Isolate_07_readAnswer].
self theAg_Isolate_08s do: [:fm | fm Ag_Isolate_08_readAnswer].
self theAg_Isolate_09s do: [:fm | fm Ag_Isolate_09_readAnswer].
self theAg_Isolate_10s do: [:fm | fm Ag_Isolate_10_readAnswer].
self theAg_Isolate_11s do: [:fm | fm Ag_Isolate_11_readAnswer].
self theAg_Isolate_12s do: [:fm | fm Ag_Isolate_12_readAnswer].
self theAg_Isolate_13s do: [:fm | fm Ag_Isolate_13_sendMsgHelp].
self theAg_Isolate_14s do: [:fm | fm Ag_Isolate_14_sendMsgHelp].
self theAg_Isolate_15s do: [:fm | fm Ag_Isolate_15_sendMsgHelp].
self theAg_Isolate_16s do: [:fm | fm Ag_Isolate_16_sendMsgHelp].
self theAg_Isolate_17s do: [:fm | fm Ag_Isolate_17_sendMsgHelp].
self theAg_Isolate_18s do: [:fm | fm Ag_Isolate_18_sendMsgHelp].
self theAg_Isolate_13s do: [:fm | fm Ag_Isolate_13_readMsgHelpAndAnswer].
self theAg_Isolate_14s do: [:fm | fm Ag_Isolate_14_readMsgHelpAndAnswer].
self theAg_Isolate_15s do: [:fm | fm Ag_Isolate_15_readMsgHelpAndAnswer].
self theAg_Isolate_16s do: [:fm | fm Ag_Isolate_16_readMsgHelpAndAnswer].
self theAg_Isolate_17s do: [:fm | fm Ag_Isolate_17_readMsgHelpAndAnswer].
self theAg_Isolate_18s do: [:fm | fm Ag_Isolate_18_readMsgHelpAndAnswer].
self theAg_Isolate_13s do: [:fm | fm Ag_Isolate_13_readAnswer].
self theAg_Isolate_14s do: [:fm | fm Ag_Isolate_14_readAnswer].
self theAg_Isolate_15s do: [:fm | fm Ag_Isolate_15_readAnswer].
self theAg_Isolate_16s do: [:fm | fm Ag_Isolate_16_readAnswer].
self theAg_Isolate_17s do: [:fm | fm Ag_Isolate_17_readAnswer].
self theAg_Isolate_18s do: [:fm | fm Ag_Isolate_18_readAnswer].
"RELATIVE TO JUVENILES---------------------------------------------------"
self theESE do: [:aCell | aCell updateSurvivalRateIsolate].
self theESE do: [:aCell | aCell diePTMJuveniles].
"RELATIVE TO ADULTS--------------------------------------------------------"
self theESE do: [:aCell | aCell diePTMAdults].
self theESE do: [:aCell | aCell movePTM_exp].
self theESE do: [:aCell | aCell updatePTMdispersion].
"RELATIVE TO FEMALES------------------------------------------------------"
self theESE do: [:aCell | aCell updateRateLife].
self theESE do: [:aCell | aCell updateFecundityFemale].
self theESE do: [:aCell | aCell reproduceFemales].
self theESE do: [:aCell | aCell dieAllPTM].
CormasNS.Models.SimPolillaSimiatug_v02.SimPolillaSimiatug_v02 instance-creation
initAgents
|x1 x2 x3 x4 x5 i|
"US = One agent per land, 6 agents per community"
x1:=1.
x2:=1.
x3:=1.
x4:=1.
x5:=1.
super initAgents.
i:=1.
90 timesRepeat:[
self setRandomlyLocatedAgents: Agri01 n: x1 constrainedBy: [:f | f agroPart=i].
self setRandomlyLocatedAgents: Agri02 n: x2 constrainedBy: [:f | f agroPart=i].
self setRandomlyLocatedAgents: Agri03 n: x3 constrainedBy: [:f | f agroPart=i].
self setRandomlyLocatedAgents: Agri04 n: x4 constrainedBy: [:f | f agroPart=i].
self setRandomlyLocatedAgents: Agri05 n: x5 constrainedBy: [:f | f agroPart=i].
i:= i+1].
self generateSymetricNetworkDensity: 1 forAgents: Agri01.
self generateSymetricNetworkDensity: 1 forAgents: Agri02.
self generateSymetricNetworkDensity: 1 forAgents: Agri03.
self generateSymetricNetworkDensity: 1 forAgents: Agri04.
self generateSymetricNetworkDensity: 1 forAgents: Agri05.
initAgentsIsolate
super initAgents.
self setRandomlyLocatedAgents: Ag_Isolate_01 n: 1 constrainedBy: [:f | f agroPartPart=1].
self setRandomlyLocatedAgents: Ag_Isolate_02 n: 1 constrainedBy: [:f | f agroPartPart=2].
self setRandomlyLocatedAgents: Ag_Isolate_03 n: 1 constrainedBy: [:f | f agroPartPart=3].
self setRandomlyLocatedAgents: Ag_Isolate_04 n: 1 constrainedBy: [:f | f agroPartPart=4].
self setRandomlyLocatedAgents: Ag_Isolate_05 n: 1 constrainedBy: [:f | f agroPartPart=5].
self setRandomlyLocatedAgents: Ag_Isolate_06 n: 1 constrainedBy: [:f | f agroPartPart=6].
self setRandomlyLocatedAgents: Ag_Isolate_07 n: 1 constrainedBy: [:f | f agroPartPart=7].
self setRandomlyLocatedAgents: Ag_Isolate_08 n: 1 constrainedBy: [:f | f agroPartPart=8].
self setRandomlyLocatedAgents: Ag_Isolate_09 n: 1 constrainedBy: [:f | f agroPartPart=9].
self setRandomlyLocatedAgents: Ag_Isolate_10 n: 1 constrainedBy: [:f | f agroPartPart=10].
self setRandomlyLocatedAgents: Ag_Isolate_11 n: 1 constrainedBy: [:f | f agroPartPart=11].
self setRandomlyLocatedAgents: Ag_Isolate_12 n: 1 constrainedBy: [:f | f agroPartPart=12].
self setRandomlyLocatedAgents: Ag_Isolate_13 n: 1 constrainedBy: [:f | f agroPartPart=13].
self setRandomlyLocatedAgents: Ag_Isolate_14 n: 1 constrainedBy: [:f | f agroPartPart=14].
self setRandomlyLocatedAgents: Ag_Isolate_15 n: 1 constrainedBy: [:f | f agroPartPart=15].
self setRandomlyLocatedAgents: Ag_Isolate_16 n: 1 constrainedBy: [:f | f agroPartPart=16].
self setRandomlyLocatedAgents: Ag_Isolate_17 n: 1 constrainedBy: [:f | f agroPartPart=17].
self setRandomlyLocatedAgents: Ag_Isolate_18 n: 1 constrainedBy: [:f | f agroPartPart=18].
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_01.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_02.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_03.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_04.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_05.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_06.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_07.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_08.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_09.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_10.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_11.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_12.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_13.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_14.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_15.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_16.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_17.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_18.
initAgentsIsolateSeul
super initAgents.
self setRandomlyLocatedAgents: Ag_Isolate_01 n: 1 constrainedBy: [:f | f agroPartPart=1].
self setRandomlyLocatedAgents: Ag_Isolate_02 n: 1 constrainedBy: [:f | f agroPartPart=2].
self setRandomlyLocatedAgents: Ag_Isolate_03 n: 1 constrainedBy: [:f | f agroPartPart=3].
self setRandomlyLocatedAgents: Ag_Isolate_04 n: 1 constrainedBy: [:f | f agroPartPart=4].
self setRandomlyLocatedAgents: Ag_Isolate_05 n: 1 constrainedBy: [:f | f agroPartPart=5].
self setRandomlyLocatedAgents: Ag_Isolate_06 n: 1 constrainedBy: [:f | f agroPartPart=6].
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_01.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_02.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_03.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_04.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_05.
self generateSymetricNetworkDensity: 1 forAgents: Ag_Isolate_06.
initAggregates
self spaceModel
setAggregates: Aggregate
from: Cell
verifying: [:f | f bufferNumberTeciaFemale>10
or: [ f bufferNumberPhthorimaeaFemale>10
or: [ f bufferNumberSymmetrischemaFemale>10]]]
initAggregatesPhthorimaea
self spaceModel
setAggregates: AggregatePhthorimaea
from: Cell
verifying: [:f | f bufferNumberPhthorimaeaFemale>10]
initAggregatesSymmetrischema
self spaceModel
setAggregates: AggregateSymmetrischema
from: Cell
verifying: [:f | f bufferNumberSymmetrischemaFemale>10]
initAggregatesTecia
self spaceModel
setAggregates: AggregateTecia
from: Cell
verifying: [:f | f bufferNumberTeciaFemale>10]
Agri01
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation areaTotal riego maquinaria semillaPapa rotationVariedad aproFerti almacen listeAgent stockSend stockRead
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Agri01
Agri01 representa a los agentes papicultores que tienen un nivel de capacitación o de conocimiento de uno, es decir lo mas bajo.
Instance Variables:
almacen <SmallInteger> description of almacen
aproFerti <SmallInteger> si=1 y no=0
areaTotal <SmallInteger> description of areaTotal
maquinaria <SmallInteger> si=1 y no=0
nivelFormation <SmallInteger> nivel = 1
riego <SmallInteger> description of riego
rotationVariedad <SmallInteger> description of rotationVariedad
semillaPapa <SmallInteger> description of semillaPapa
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 init
init
self listeAgent: OrderedCollection new.
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 control
step
"to be completed"
step001
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step01
self alarmCalling.
self readMail.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step01_Part
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 pov
pov
^#Agri01.
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 rules
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2.
seuil:=100/self nivelFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch bufferNumberPhthorimaeaFemale>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*(1-eficacidadTratamientoChimico)].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*(1-eficacidadTratamientoChimico)].
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 accessing
almacen
"Getter accessor with default value = 1 "
^almacen ifNil:[almacen := 1]
almacen: anObject
almacen := anObject
aproFerti
"Getter accessor with default value = 1 "
^aproFerti ifNil:[aproFerti := 1]
aproFerti: anObject
aproFerti := anObject
areaTotal
"Getter accessor with default value = 1 "
^areaTotal ifNil:[areaTotal := 1]
areaTotal: anObject
areaTotal := anObject
listeAgent
^listeAgent
listeAgent: anObject
listeAgent := anObject
maquinaria
"Getter accessor with default value = 1 "
^maquinaria ifNil:[maquinaria := 1]
maquinaria: anObject
maquinaria := anObject
nivelFormation
"Getter accessor with default value = 1 "
^nivelFormation ifNil:[nivelFormation := 1]
nivelFormation: anObject
nivelFormation := anObject
riego
"Getter accessor with default value = 1 "
^riego ifNil:[riego := 1]
riego: anObject
riego := anObject
rotationVariedad
"Getter accessor with default value = 1 "
^rotationVariedad ifNil:[rotationVariedad := 1]
rotationVariedad: anObject
rotationVariedad := anObject
semillaPapa
"Getter accessor with default value = 1 "
^semillaPapa ifNil:[semillaPapa := 1]
semillaPapa: anObject
semillaPapa := anObject
stockRead
^stockRead
stockRead: anObject
stockRead := anObject
stockSend
^stockSend
stockSend: anObject
stockSend := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Agri01 msg
alarmCalling
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas agriOnMyCell|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
agriOnMyCell := IndexedSet new.
1 to: 5 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Agri0', i printString) asSymbol) withinRange: 5)].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
agriOnMyCell do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm]].
alarmCallingAggregate
| alarmT alarmP alarmS alarm teciaedCell phthedCell symedCell PTMCell aggregateT aggregateP aggregateS aggregateTOT numCellPTM tot|
numCellPTM:=5.
tot:=150.
teciaedCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
phthedCell := self patch neighbourhood detect: [:f | f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
symedCell := self patch neighbourhood detect: [:f | f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
PTMCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))]]] ifNone: [^nil].
aggregateT := teciaedCell theCSE at: #AggregateTecia.
aggregateP := phthedCell theCSE at: #AggregatePhthorimaea.
aggregateS := symedCell theCSE at: #AggregateSymmetrischema.
aggregateTOT := PTMCell theCSE at: #Aggregate.
aggregateTOT size > numCellPTM
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: aggregateTOT components).
alarm receiver: x.
self sendMessageAsynchronously: alarm]].
alarmCalling_v01
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas emit|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm].
emit:=1.
90 timesRepeat:[
self patch agroPart = emit ifTrue:[self stockSend: emit]
ifFalse:[emit:=emit+1]]].
readMail
| aMessage |
aMessage := self nextMessage.
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]
readMail_v01
| aMessage recept|
aMessage := self nextMessage.
recept:=1.
90 timesRepeat:[
self patch agroPart = recept ifTrue:[self stockRead: recept]
ifFalse:[recept:=recept+1]].
self stockRead = self stockSend ifTrue:[
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]]
Agri05
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation areaTotal riego maquinaria semillaPapa rotationVariedad aproFerti almacen
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Agri05
Agri05 representa a los agentes papicultores que tienen un nivel de capacitación o de conocimiento de 5.
Instance Variables:
almacen <SmallInteger> description of almacen
aproFerti <SmallInteger> si=1 y no=0
areaTotal <SmallInteger> description of areaTotal
maquinaria <SmallInteger> si=1 y no=0
nivelFormation <SmallInteger> nivel = 5
riego <SmallInteger> description of riego
rotationVariedad <SmallInteger> description of rotationVariedad
semillaPapa <SmallInteger> description of semillaPapa
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 control
step
"to be completed"
step005
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step05
self alarmCalling.
self readMail.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step05_Part
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 pov
pov
^#Agri05.
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 rules
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2.
seuil:=100/self nivelFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch bufferNumberPhthorimaeaFemale>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*(1-eficacidadTratamientoChimico)].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*(1-eficacidadTratamientoChimico)].
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 accessing
almacen
"Getter accessor with default value = 1 "
^almacen ifNil:[almacen := 1]
almacen: anObject
almacen := anObject
aproFerti
"Getter accessor with default value = 1 "
^aproFerti ifNil:[aproFerti := 1]
aproFerti: anObject
aproFerti := anObject
areaTotal
"Getter accessor with default value = 1 "
^areaTotal ifNil:[areaTotal := 1]
areaTotal: anObject
areaTotal := anObject
maquinaria
"Getter accessor with default value = 1 "
^maquinaria ifNil:[maquinaria := 1]
maquinaria: anObject
maquinaria := anObject
nivelFormation
"Getter accessor with default value = 5 "
^nivelFormation ifNil:[nivelFormation := 5]
nivelFormation: anObject
nivelFormation := anObject
riego
"Getter accessor with default value = 1 "
^riego ifNil:[riego := 1]
riego: anObject
riego := anObject
rotationVariedad
"Getter accessor with default value = 1 "
^rotationVariedad ifNil:[rotationVariedad := 1]
rotationVariedad: anObject
rotationVariedad := anObject
semillaPapa
"Getter accessor with default value = 1 "
^semillaPapa ifNil:[semillaPapa := 1]
semillaPapa: anObject
semillaPapa := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Agri05 msg
alarmCalling
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas agriOnMyCell|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
agriOnMyCell := IndexedSet new.
1 to: 5 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Agri0', i printString) asSymbol) withinRange: 5)].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
agriOnMyCell do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm]].
alarmCallingAggregate
| alarmT alarmP alarmS alarm teciaedCell phthedCell symedCell PTMCell aggregateT aggregateP aggregateS aggregate numCellPTM tot|
numCellPTM:=10.
tot:=150.
teciaedCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
phthedCell := self patch neighbourhood detect: [:f | f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
symedCell := self patch neighbourhood detect: [:f | f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
PTMCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))]]] ifNone: [^nil].
aggregateT := teciaedCell theCSE at: #AggregateTecia.
aggregateP := phthedCell theCSE at: #AggregatePhthorimaea.
aggregateS := symedCell theCSE at: #AggregateSymmetrischema.
aggregate := PTMCell theCSE at: #Aggregate.
aggregate size > numCellPTM
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: aggregate components).
alarm receiver: x.
self sendMessageAsynchronously: alarm]].
readMail
| aMessage |
aMessage := self nextMessage.
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]
MsgHelpAns
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.Msg
false
none
location nivel ag
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.MsgHelpAns accessing
ag
^ag
ag: anObject
ag := anObject
location
^location
location: anObject
location := anObject
nivel
^nivel
nivel: anObject
nivel := anObject
AggregatePhthorimaea
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.SpatialEntityAggregate
false
none
agrePht
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.AggregatePhthorimaea init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.AggregatePhthorimaea accessing
agrePht
^agrePht ifNil:[agrePht := 10]
agrePht: anObject
agrePht := anObject
CormasNS.Models.SimPolillaSimiatug_v02.AggregatePhthorimaea pov
pov
^self size > self agrePht
ifTrue: [#needHelp]
ifFalse: [#noHelpNeeded]
Agri02
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation areaTotal riego maquinaria semillaPapa rotationVariedad aproFerti almacen
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Agri02
Agri02 representa a los agentes papicultores que tienen un nivel de capacitación o de conocimiento de 2.
Instance Variables:
almacen <SmallInteger> description of almacen
aproFerti <SmallInteger> si=1 y no=0
areaTotal <SmallInteger> description of areaTotal
maquinaria <SmallInteger> si=1 y no=0
nivelFormation <SmallInteger> nivel = 2
riego <SmallInteger> description of riego
rotationVariedad <SmallInteger> description of rotationVariedad
semillaPapa <SmallInteger> description of semillaPapa
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 control
step
"to be completed"
step002
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step02
self alarmCalling.
self readMail.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step02_Part
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 pov
pov
^#Agri02.
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 rules
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2.
seuil:=100/self nivelFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch bufferNumberPhthorimaeaFemale>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*(1-eficacidadTratamientoChimico)].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*(1-eficacidadTratamientoChimico)].
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 accessing
almacen
"Getter accessor with default value = 1 "
^almacen ifNil:[almacen := 1]
almacen: anObject
almacen := anObject
aproFerti
"Getter accessor with default value = 1 "
^aproFerti ifNil:[aproFerti := 1]
aproFerti: anObject
aproFerti := anObject
areaTotal
"Getter accessor with default value = 1 "
^areaTotal ifNil:[areaTotal := 1]
areaTotal: anObject
areaTotal := anObject
maquinaria
"Getter accessor with default value = 1 "
^maquinaria ifNil:[maquinaria := 1]
maquinaria: anObject
maquinaria := anObject
nivelFormation
"Getter accessor with default value = 2 "
^nivelFormation ifNil:[nivelFormation := 2]
nivelFormation: anObject
nivelFormation := anObject
riego
"Getter accessor with default value = 1 "
^riego ifNil:[riego := 1]
riego: anObject
riego := anObject
rotationVariedad
"Getter accessor with default value = 1 "
^rotationVariedad ifNil:[rotationVariedad := 1]
rotationVariedad: anObject
rotationVariedad := anObject
semillaPapa
"Getter accessor with default value = 1 "
^semillaPapa ifNil:[semillaPapa := 1]
semillaPapa: anObject
semillaPapa := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Agri02 msg
alarmCalling
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas agriOnMyCell|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
agriOnMyCell := IndexedSet new.
1 to: 5 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Agri0', i printString) asSymbol) withinRange: 5)].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
agriOnMyCell do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm]].
alarmCallingAggregate
| alarmT alarmP alarmS alarm teciaedCell phthedCell symedCell PTMCell aggregateT aggregateP aggregateS aggregate numCellPTM tot|
numCellPTM:=10.
tot:=150.
teciaedCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
phthedCell := self patch neighbourhood detect: [:f | f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
symedCell := self patch neighbourhood detect: [:f | f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
PTMCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))]]] ifNone: [^nil].
aggregateT := teciaedCell theCSE at: #AggregateTecia.
aggregateP := phthedCell theCSE at: #AggregatePhthorimaea.
aggregateS := symedCell theCSE at: #AggregateSymmetrischema.
aggregate := PTMCell theCSE at: #Aggregate.
aggregate size > numCellPTM
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: aggregate components).
alarm receiver: x.
self sendMessageAsynchronously: alarm]].
readMail
| aMessage |
aMessage := self nextMessage.
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]
Cell
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.SpatialEntityElement
false
none
altura pluvioAnual tempMini tempMaxi tempPromedio agro qualityHabitat tecia bufferTecia rateLifeTecia rateLifePhthorimaea rateLifeSymmetrischemma phthorimaea symmetrischemma bufferPhthorimaea bufferSymmetrischemma survivalRateTecia survivalRatePhthorimaea survivalRateSymmetrischemma fecundityTecia fecundityPhthorimaea fecunditySymmetrischemma stochastic roads bodega tempStochastic rain1 rain2 rain3 rain4 rain5 rain6 rain7 rain8 rain9 rain10 rain11 rain12 rainEffectJuveniles rainEffectAdults teciaAdults phthorimaeaAdults symmetrischemaAdults teciaFemale phthorimaeaFemale symmetrischemaFemale rT rP rS bufferNumberPhthorimaeaFemale moveT moveP moveS bufferNumberTeciaFemale bufferNumberSymmetrischemaFemale village village2 dispersalJumpv01 dispersalJumpv02 dispersalJumpv03 dispersalJumpv04 dispersalJumpv05 dispersalJumpv06 dispersalJumpv07 dispersalJumpv08 dispersalJumpv09 dispersalJumpv10 dispersalJumpv11 dispersalJumpv12 dispersalJumpv13 dispersalJumpv14 dispersalJumpv15 dispersalJumpv16 dispersalJumpv17 dispersalJumpv18 dispersalJumpv19 dispersalJumpv20 dispersalJumpv21 dispersalJumpv22 dispersalJumpv23 dispersalJumpv24 dispersalJumpv25 dispersalJumpv26 dispersalJumpv27 dispersalJumpv28 dispersalJumpv29 dispersalJumpv30 dispersalJumpv31 dispersalJumpv32 dispersalJumpv33 dispersalJumpv34 dispersalJumpp01 dispersalJumpp02 dispersalJumpp03 dispersalJumpp04 dispersalJumpp05 dispersalJumpp06 dispersalJumpp07 dispersalJumpp08 dispersalJumpp09 dispersalJumpp10 dispersalJumpp11 dispersalJumpp12 dispersalJumpp13 dispersalJumpp14 dispersalJumpp15 dispersalJumpp16 dispersalJumpp17 dispersalJumpp18 dispersalJumpp19 dispersalJumpp20 dispersalJumpp21 dispersalJumpp22 dispersalJumpp23 dispersalJumpp24 dispersalJumpp25 dispersalJumpp26 dispersalJumpp27 dispersalJumpp28 dispersalJumpp29 dispersalJumpp30 dispersalJumpp31 dispersalJumpp32 dispersalJumpp33 dispersalJumpp34 dispersalJumps01 dispersalJumps02 dispersalJumps03 dispersalJumps04 dispersalJumps05 dispersalJumps06 dispersalJumps07 dispersalJumps08 dispersalJumps09 dispersalJumps10 dispersalJumps11 dispersalJumps12 dispersalJumps13 dispersalJumps14 dispersalJumps15 dispersalJumps16 dispersalJumps17 dispersalJumps18 dispersalJumps19 dispersalJumps20 dispersalJumps21 dispersalJumps22 dispersalJumps23 dispersalJumps24 dispersalJumps25 dispersalJumps26 dispersalJumps27 dispersalJumps28 dispersalJumps29 dispersalJumps30 dispersalJumps31 dispersalJumps32 dispersalJumps33 dispersalJumps34 population probe agroPart agroPartPart bodegaDensityA bodegaDensityP stoPec stoPec2
k r
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Cell class accessing
k
"Getter accessor with default value = 1000 "
^k ifNil:[k := 1000]
k: anObject
k := anObject
r
"Getter accessor with default value = 0.2 "
^r ifNil:[r := 0.2]
r: anObject
r := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Cell init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Cell accessing
agro
"US = agro is a layer representing land use (1=crops, 0=other)"
"ES = agro es una capa que representa el uso del suelo.
cuando agro toma el valor 1, representa una zona donde hay un cultivo de ciclo corto
cuando agro toma el valor 0, representa una zona con otro uso o sin uso (parámos, ciclo largo, ...)
agro no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^agro ifNil:[agro := 0].
"Si agro no tiene un valor (agro=Nil que significa nada), toma el valor 0"
agro: anObject
agro := anObject
agroPart
"US = layer to distinguish between the 3 communities of the initial model"
"ES = para representar las distintas comunidades de la zona"
^agroPart ifNil:[agro := 1]
agroPart: anObject
agroPart := anObject
agroPartPart
"Getter accessor without default value "
^agroPartPart
agroPartPart: anObject
agroPartPart := anObject
altura
"US = eleveation in m.a.s.l."
"ES = altura es una capa que representa la altura en m.s.n.m..
altura no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^altura ifNil:[altura := 0]
"Si altura no tiene un valor (altura=Nil que significa nada), toma el valor 0"
altura: anObject
altura := anObject
bodega
"US = representation of local storage facilities, not use in the model"
"ES = bodega es una capa que representa si hay o no una bodega en el lugar considerado.
cuando bodega toma el valor 1, representa una zona donde hay una bodega
cuando bodega toma el valor 0, representa una zona donde no hay una bodega
bodega no es generado por el modelo sino que viene de una capa hecha con Excel, teoricamente, adentro del archivo *.env que inicia una simulación"
^bodega
"Si bodega no tiene un valor (bodega=Nil que significa nada), toma el valor 0"
bodega: anObject
bodega := anObject
bodegaDensityA
^bodegaDensityA
bodegaDensityA: anObject
bodegaDensityA := anObject
bodegaDensityP
^bodegaDensityP
bodegaDensityP: anObject
bodegaDensityP := anObject
bufferNumberPhthorimaeaFemale
"US = number of gravid females before reproduction: output of the pest model"
"ES = Representa el numero de hembras al final de una generación, es decir antes que se mueren.
Sirve para hacer curvas y para representar las hembras en el modulo SPACE"
^bufferNumberPhthorimaeaFemale ifNil:[bufferNumberPhthorimaeaFemale := 0]
bufferNumberPhthorimaeaFemale: anObject
bufferNumberPhthorimaeaFemale := anObject
bufferNumberSymmetrischemaFemale
"US = number of gravid females before reproduction: output of the pest model"
"ES = Representa el numero de hembras al final de una generación, es decir antes que se mueren.
Sirve para hacer curvas y para representar las hembras en el modulo SPACE"
^bufferNumberSymmetrischemaFemale ifNil:[bufferNumberSymmetrischemaFemale := 0]
bufferNumberSymmetrischemaFemale: anObject
bufferNumberSymmetrischemaFemale := anObject
bufferNumberTeciaFemale
"US = number of gravid females before reproduction: output of the pest model"
"ES = Representa el numero de hembras al final de una generación, es decir antes que se mueren.
Sirve para hacer curvas y para representar las hembras en el modulo SPACE"
^bufferNumberTeciaFemale ifNil:[bufferNumberTeciaFemale := 0]
bufferNumberTeciaFemale: anObject
bufferNumberTeciaFemale := anObject
bufferPhthorimaea
"US = buffer layer to store pest diffusion"
"ES = Representa una capa que guarda el numero de polillas que se mueven por difusión (hay dos tipos de dispersión, por difusión es decir por la distancia de vuelo de la polilla y por saltación, es decir por los movimientos de los humanos de un mercado a un campo)"
^bufferPhthorimaea ifNil:[bufferPhthorimaea := 0]
bufferPhthorimaea: anObject
bufferPhthorimaea := anObject
bufferSymmetrischemma
"US = buffer layer to store pest diffusion"
"ES = Representa una capa que guarda el numero de polillas que se mueven por difusión (hay dos tipos de dispersión, por difusión es decir por la distancia de vuelo de la polilla y por saltación, es decir por los movimientos de los humanos de un mercado a un campo)"
^bufferSymmetrischemma ifNil:[bufferSymmetrischemma := 0]
bufferSymmetrischemma: anObject
bufferSymmetrischemma := anObject
bufferTecia
"US = buffer layer to store pest diffusion"
"ES = Representa una capa que guarda el numero de polillas que se mueven por difusión (hay dos tipos de dispersión, por difusión es decir por la distancia de vuelo de la polilla y por saltación, es decir por los movimientos de los humanos de un mercado a un campo)"
^bufferTecia ifNil:[bufferTecia := 0]
bufferTecia: anObject
bufferTecia := anObject
dispersalJumpp01
"US = buffer layer to store pest dispersion"
"ES = Representa una capa que guarda el numero de polillas que se mueven por saltación (hay dos tipos de dispersión, por difusión es decir por la distancia de vuelo de la polilla y por saltación, es decir por los movimientos de los humanos de un mercado a un campo)"
^dispersalJumpp01 ifNil:[dispersalJumpp01 := 0]
dispersalJumpp01: anObject
dispersalJumpp01 := anObject
dispersalJumpp02
"Getter accessor with default value = 0 "
^dispersalJumpp02 ifNil:[dispersalJumpp02 := 0]
dispersalJumpp02: anObject
dispersalJumpp02 := anObject
dispersalJumpp03
"Getter accessor with default value = 0 "
^dispersalJumpp03 ifNil:[dispersalJumpp03 := 0]
dispersalJumpp03: anObject
dispersalJumpp03 := anObject
dispersalJumpp04
"Getter accessor with default value = 0 "
^dispersalJumpp04 ifNil:[dispersalJumpp04 := 0]
dispersalJumpp04: anObject
dispersalJumpp04 := anObject
dispersalJumpp05
"Getter accessor with default value = 0 "
^dispersalJumpp05 ifNil:[dispersalJumpp05 := 0]
dispersalJumpp05: anObject
dispersalJumpp05 := anObject
dispersalJumpp06
"Getter accessor with default value = 0 "
^dispersalJumpp06 ifNil:[dispersalJumpp06 := 0]
dispersalJumpp06: anObject
dispersalJumpp06 := anObject
dispersalJumpp07
"Getter accessor with default value = 0 "
^dispersalJumpp07 ifNil:[dispersalJumpp07 := 0]
dispersalJumpp07: anObject
dispersalJumpp07 := anObject
dispersalJumpp08
"Getter accessor with default value = 0 "
^dispersalJumpp08 ifNil:[dispersalJumpp08 := 0]
dispersalJumpp08: anObject
dispersalJumpp08 := anObject
dispersalJumpp09
"Getter accessor with default value = 0 "
^dispersalJumpp09 ifNil:[dispersalJumpp09 := 0]
dispersalJumpp09: anObject
dispersalJumpp09 := anObject
dispersalJumpp10
"Getter accessor with default value = 0 "
^dispersalJumpp10 ifNil:[dispersalJumpp10 := 0]
dispersalJumpp10: anObject
dispersalJumpp10 := anObject
dispersalJumpp11
"Getter accessor with default value = 0 "
^dispersalJumpp11 ifNil:[dispersalJumpp11 := 0]
dispersalJumpp11: anObject
dispersalJumpp11 := anObject
dispersalJumpp12
"Getter accessor with default value = 0 "
^dispersalJumpp12 ifNil:[dispersalJumpp12 := 0]
dispersalJumpp12: anObject
dispersalJumpp12 := anObject
dispersalJumpp13
"Getter accessor with default value = 0 "
^dispersalJumpp13 ifNil:[dispersalJumpp13 := 0]
dispersalJumpp13: anObject
dispersalJumpp13 := anObject
dispersalJumpp14
"Getter accessor with default value = 0 "
^dispersalJumpp14 ifNil:[dispersalJumpp14 := 0]
dispersalJumpp14: anObject
dispersalJumpp14 := anObject
dispersalJumpp15
"Getter accessor with default value = 0 "
^dispersalJumpp15 ifNil:[dispersalJumpp15 := 0]
dispersalJumpp15: anObject
dispersalJumpp15 := anObject
dispersalJumpp16
"Getter accessor with default value = 0 "
^dispersalJumpp16 ifNil:[dispersalJumpp16 := 0]
dispersalJumpp16: anObject
dispersalJumpp16 := anObject
dispersalJumpp17
"Getter accessor with default value = 0 "
^dispersalJumpp17 ifNil:[dispersalJumpp17 := 0]
dispersalJumpp17: anObject
dispersalJumpp17 := anObject
dispersalJumpp18
"Getter accessor with default value = 0 "
^dispersalJumpp18 ifNil:[dispersalJumpp18 := 0]
dispersalJumpp18: anObject
dispersalJumpp18 := anObject
dispersalJumpp19
"Getter accessor with default value = 0 "
^dispersalJumpp19 ifNil:[dispersalJumpp19 := 0]
dispersalJumpp19: anObject
dispersalJumpp19 := anObject
dispersalJumpp20
"Getter accessor with default value = 0 "
^dispersalJumpp20 ifNil:[dispersalJumpp20 := 0]
dispersalJumpp20: anObject
dispersalJumpp20 := anObject
dispersalJumpp21
"Getter accessor with default value = 0 "
^dispersalJumpp21 ifNil:[dispersalJumpp21 := 0]
dispersalJumpp21: anObject
dispersalJumpp21 := anObject
dispersalJumpp22
"Getter accessor with default value = 0 "
^dispersalJumpp22 ifNil:[dispersalJumpp22 := 0]
dispersalJumpp22: anObject
dispersalJumpp22 := anObject
dispersalJumpp23
"Getter accessor with default value = 0 "
^dispersalJumpp23 ifNil:[dispersalJumpp23 := 0]
dispersalJumpp23: anObject
dispersalJumpp23 := anObject
dispersalJumpp24
"Getter accessor with default value = 0 "
^dispersalJumpp24 ifNil:[dispersalJumpp24 := 0]
dispersalJumpp24: anObject
dispersalJumpp24 := anObject
dispersalJumpp25
"Getter accessor with default value = 0 "
^dispersalJumpp25 ifNil:[dispersalJumpp25 := 0]
dispersalJumpp25: anObject
dispersalJumpp25 := anObject
dispersalJumpp26
"Getter accessor with default value = 0 "
^dispersalJumpp26 ifNil:[dispersalJumpp26 := 0]
dispersalJumpp26: anObject
dispersalJumpp26 := anObject
dispersalJumpp27
"Getter accessor with default value = 0 "
^dispersalJumpp27 ifNil:[dispersalJumpp27 := 0]
dispersalJumpp27: anObject
dispersalJumpp27 := anObject
dispersalJumpp28
"Getter accessor with default value = 0 "
^dispersalJumpp28 ifNil:[dispersalJumpp28 := 0]
dispersalJumpp28: anObject
dispersalJumpp28 := anObject
dispersalJumpp29
"Getter accessor with default value = 0 "
^dispersalJumpp29 ifNil:[dispersalJumpp29 := 0]
dispersalJumpp29: anObject
dispersalJumpp29 := anObject
dispersalJumpp30
"Getter accessor with default value = 0 "
^dispersalJumpp30 ifNil:[dispersalJumpp30 := 0]
dispersalJumpp30: anObject
dispersalJumpp30 := anObject
dispersalJumpp31
"Getter accessor with default value = 0 "
^dispersalJumpp31 ifNil:[dispersalJumpp31 := 0]
dispersalJumpp31: anObject
dispersalJumpp31 := anObject
dispersalJumpp32
"Getter accessor with default value = 0 "
^dispersalJumpp32 ifNil:[dispersalJumpp32 := 0]
dispersalJumpp32: anObject
dispersalJumpp32 := anObject
dispersalJumpp33
"Getter accessor with default value = 0 "
^dispersalJumpp33 ifNil:[dispersalJumpp33 := 0]
dispersalJumpp33: anObject
dispersalJumpp33 := anObject
dispersalJumpp34
"Getter accessor with default value = 0 "
^dispersalJumpp34 ifNil:[dispersalJumpp34 := 0]
dispersalJumpp34: anObject
dispersalJumpp34 := anObject
dispersalJumps01
"Getter accessor with default value = 0 "
^dispersalJumps01 ifNil:[dispersalJumps01 := 0]
dispersalJumps01: anObject
dispersalJumps01 := anObject
dispersalJumps02
"Getter accessor with default value = 0 "
^dispersalJumps02 ifNil:[dispersalJumps02 := 0]
dispersalJumps02: anObject
dispersalJumps02 := anObject
dispersalJumps03
"Getter accessor with default value = 0 "
^dispersalJumps03 ifNil:[dispersalJumps03 := 0]
dispersalJumps03: anObject
dispersalJumps03 := anObject
dispersalJumps04
"Getter accessor with default value = 0 "
^dispersalJumps04 ifNil:[dispersalJumps04 := 0]
dispersalJumps04: anObject
dispersalJumps04 := anObject
dispersalJumps05
"Getter accessor with default value = 0 "
^dispersalJumps05 ifNil:[dispersalJumps05 := 0]
dispersalJumps05: anObject
dispersalJumps05 := anObject
dispersalJumps06
"Getter accessor with default value = 0 "
^dispersalJumps06 ifNil:[dispersalJumps06 := 0]
dispersalJumps06: anObject
dispersalJumps06 := anObject
dispersalJumps07
"Getter accessor with default value = 0 "
^dispersalJumps07 ifNil:[dispersalJumps07 := 0]
dispersalJumps07: anObject
dispersalJumps07 := anObject
dispersalJumps08
"Getter accessor with default value = 0 "
^dispersalJumps08 ifNil:[dispersalJumps08 := 0]
dispersalJumps08: anObject
dispersalJumps08 := anObject
dispersalJumps09
"Getter accessor with default value = 0 "
^dispersalJumps09 ifNil:[dispersalJumps09 := 0]
dispersalJumps09: anObject
dispersalJumps09 := anObject
dispersalJumps10
"Getter accessor with default value = 0 "
^dispersalJumps10 ifNil:[dispersalJumps10 := 0]
dispersalJumps10: anObject
dispersalJumps10 := anObject
dispersalJumps11
"Getter accessor with default value = 0 "
^dispersalJumps11 ifNil:[dispersalJumps11 := 0]
dispersalJumps11: anObject
dispersalJumps11 := anObject
dispersalJumps12
"Getter accessor with default value = 0 "
^dispersalJumps12 ifNil:[dispersalJumps12 := 0]
dispersalJumps12: anObject
dispersalJumps12 := anObject
dispersalJumps13
"Getter accessor with default value = 0 "
^dispersalJumps13 ifNil:[dispersalJumps13 := 0]
dispersalJumps13: anObject
dispersalJumps13 := anObject
dispersalJumps14
"Getter accessor with default value = 0 "
^dispersalJumps14 ifNil:[dispersalJumps14 := 0]
dispersalJumps14: anObject
dispersalJumps14 := anObject
dispersalJumps15
"Getter accessor with default value = 0 "
^dispersalJumps15 ifNil:[dispersalJumps15 := 0]
dispersalJumps15: anObject
dispersalJumps15 := anObject
dispersalJumps16
"Getter accessor with default value = 0 "
^dispersalJumps16 ifNil:[dispersalJumps16 := 0]
dispersalJumps16: anObject
dispersalJumps16 := anObject
dispersalJumps17
"Getter accessor with default value = 0 "
^dispersalJumps17 ifNil:[dispersalJumps17 := 0]
dispersalJumps17: anObject
dispersalJumps17 := anObject
dispersalJumps18
"Getter accessor with default value = 0 "
^dispersalJumps18 ifNil:[dispersalJumps18 := 0]
dispersalJumps18: anObject
dispersalJumps18 := anObject
dispersalJumps19
"Getter accessor with default value = 0 "
^dispersalJumps19 ifNil:[dispersalJumps19 := 0]
dispersalJumps19: anObject
dispersalJumps19 := anObject
dispersalJumps20
"Getter accessor with default value = 0 "
^dispersalJumps20 ifNil:[dispersalJumps20 := 0]
dispersalJumps20: anObject
dispersalJumps20 := anObject
dispersalJumps21
"Getter accessor with default value = 0 "
^dispersalJumps21 ifNil:[dispersalJumps21 := 0]
dispersalJumps21: anObject
dispersalJumps21 := anObject
dispersalJumps22
"Getter accessor with default value = 0 "
^dispersalJumps22 ifNil:[dispersalJumps22 := 0]
dispersalJumps22: anObject
dispersalJumps22 := anObject
dispersalJumps23
"Getter accessor with default value = 0 "
^dispersalJumps23 ifNil:[dispersalJumps23 := 0]
dispersalJumps23: anObject
dispersalJumps23 := anObject
dispersalJumps24
"Getter accessor with default value = 0 "
^dispersalJumps24 ifNil:[dispersalJumps24 := 0]
dispersalJumps24: anObject
dispersalJumps24 := anObject
dispersalJumps25
"Getter accessor with default value = 0 "
^dispersalJumps25 ifNil:[dispersalJumps25 := 0]
dispersalJumps25: anObject
dispersalJumps25 := anObject
dispersalJumps26
"Getter accessor with default value = 0 "
^dispersalJumps26 ifNil:[dispersalJumps26 := 0]
dispersalJumps26: anObject
dispersalJumps26 := anObject
dispersalJumps27
"Getter accessor with default value = 0 "
^dispersalJumps27 ifNil:[dispersalJumps27 := 0]
dispersalJumps27: anObject
dispersalJumps27 := anObject
dispersalJumps28
"Getter accessor with default value = 0 "
^dispersalJumps28 ifNil:[dispersalJumps28 := 0]
dispersalJumps28: anObject
dispersalJumps28 := anObject
dispersalJumps29
"Getter accessor with default value = 0 "
^dispersalJumps29 ifNil:[dispersalJumps29 := 0]
dispersalJumps29: anObject
dispersalJumps29 := anObject
dispersalJumps30
"Getter accessor with default value = 0 "
^dispersalJumps30 ifNil:[dispersalJumps30 := 0]
dispersalJumps30: anObject
dispersalJumps30 := anObject
dispersalJumps31
"Getter accessor with default value = 0 "
^dispersalJumps31 ifNil:[dispersalJumps31 := 0]
dispersalJumps31: anObject
dispersalJumps31 := anObject
dispersalJumps32
"Getter accessor with default value = 0 "
^dispersalJumps32 ifNil:[dispersalJumps32 := 0]
dispersalJumps32: anObject
dispersalJumps32 := anObject
dispersalJumps33
"Getter accessor with default value = 0 "
^dispersalJumps33 ifNil:[dispersalJumps33 := 0]
dispersalJumps33: anObject
dispersalJumps33 := anObject
dispersalJumps34
"Getter accessor with default value = 0 "
^dispersalJumps34 ifNil:[dispersalJumps34 := 0]
dispersalJumps34: anObject
dispersalJumps34 := anObject
dispersalJumpv01
"Getter accessor with default value = 0 "
^dispersalJumpv01 ifNil:[dispersalJumpv01 := 0]
dispersalJumpv01: anObject
dispersalJumpv01 := anObject
dispersalJumpv02
"Getter accessor with default value = 0 "
^dispersalJumpv02 ifNil:[dispersalJumpv02 := 0]
dispersalJumpv02: anObject
dispersalJumpv02 := anObject
dispersalJumpv03
"Getter accessor with default value = 0 "
^dispersalJumpv03 ifNil:[dispersalJumpv03 := 0]
dispersalJumpv03: anObject
dispersalJumpv03 := anObject
dispersalJumpv04
"Getter accessor with default value = 0 "
^dispersalJumpv04 ifNil:[dispersalJumpv04 := 0]
dispersalJumpv04: anObject
dispersalJumpv04 := anObject
dispersalJumpv05
"Getter accessor with default value = 0 "
^dispersalJumpv05 ifNil:[dispersalJumpv05 := 0]
dispersalJumpv05: anObject
dispersalJumpv05 := anObject
dispersalJumpv06
"Getter accessor with default value = 0 "
^dispersalJumpv06 ifNil:[dispersalJumpv06 := 0]
dispersalJumpv06: anObject
dispersalJumpv06 := anObject
dispersalJumpv07
"Getter accessor with default value = 0 "
^dispersalJumpv07 ifNil:[dispersalJumpv07 := 0]
dispersalJumpv07: anObject
dispersalJumpv07 := anObject
dispersalJumpv08
"Getter accessor with default value = 0 "
^dispersalJumpv08 ifNil:[dispersalJumpv08 := 0]
dispersalJumpv08: anObject
dispersalJumpv08 := anObject
dispersalJumpv09
"Getter accessor with default value = 0 "
^dispersalJumpv09 ifNil:[dispersalJumpv09 := 0]
dispersalJumpv09: anObject
dispersalJumpv09 := anObject
dispersalJumpv10
"Getter accessor with default value = 0 "
^dispersalJumpv10 ifNil:[dispersalJumpv10 := 0]
dispersalJumpv10: anObject
dispersalJumpv10 := anObject
dispersalJumpv11
"Getter accessor with default value = 0 "
^dispersalJumpv11 ifNil:[dispersalJumpv11 := 0]
dispersalJumpv11: anObject
dispersalJumpv11 := anObject
dispersalJumpv12
"Getter accessor with default value = 0 "
^dispersalJumpv12 ifNil:[dispersalJumpv12 := 0]
dispersalJumpv12: anObject
dispersalJumpv12 := anObject
dispersalJumpv13
"Getter accessor with default value = 0 "
^dispersalJumpv13 ifNil:[dispersalJumpv13 := 0]
dispersalJumpv13: anObject
dispersalJumpv13 := anObject
dispersalJumpv14
"Getter accessor with default value = 0 "
^dispersalJumpv14 ifNil:[dispersalJumpv14 := 0]
dispersalJumpv14: anObject
dispersalJumpv14 := anObject
dispersalJumpv15
"Getter accessor with default value = 0 "
^dispersalJumpv15 ifNil:[dispersalJumpv15 := 0]
dispersalJumpv15: anObject
dispersalJumpv15 := anObject
dispersalJumpv16
"Getter accessor with default value = 0 "
^dispersalJumpv16 ifNil:[dispersalJumpv16 := 0]
dispersalJumpv16: anObject
dispersalJumpv16 := anObject
dispersalJumpv17
"Getter accessor with default value = 0 "
^dispersalJumpv17 ifNil:[dispersalJumpv17 := 0]
dispersalJumpv17: anObject
dispersalJumpv17 := anObject
dispersalJumpv18
"Getter accessor with default value = 0 "
^dispersalJumpv18 ifNil:[dispersalJumpv18 := 0]
dispersalJumpv18: anObject
dispersalJumpv18 := anObject
dispersalJumpv19
"Getter accessor with default value = 0 "
^dispersalJumpv19 ifNil:[dispersalJumpv19 := 0]
dispersalJumpv19: anObject
dispersalJumpv19 := anObject
dispersalJumpv20
"Getter accessor with default value = 0 "
^dispersalJumpv20 ifNil:[dispersalJumpv20 := 0]
dispersalJumpv20: anObject
dispersalJumpv20 := anObject
dispersalJumpv21
"Getter accessor with default value = 0 "
^dispersalJumpv21 ifNil:[dispersalJumpv21 := 0]
dispersalJumpv21: anObject
dispersalJumpv21 := anObject
dispersalJumpv22
"Getter accessor with default value = 0 "
^dispersalJumpv22 ifNil:[dispersalJumpv22 := 0]
dispersalJumpv22: anObject
dispersalJumpv22 := anObject
dispersalJumpv23
"Getter accessor with default value = 0 "
^dispersalJumpv23 ifNil:[dispersalJumpv23 := 0]
dispersalJumpv23: anObject
dispersalJumpv23 := anObject
dispersalJumpv24
"Getter accessor with default value = 0 "
^dispersalJumpv24 ifNil:[dispersalJumpv24 := 0]
dispersalJumpv24: anObject
dispersalJumpv24 := anObject
dispersalJumpv25
"Getter accessor with default value = 0 "
^dispersalJumpv25 ifNil:[dispersalJumpv25 := 0]
dispersalJumpv25: anObject
dispersalJumpv25 := anObject
dispersalJumpv26
"Getter accessor with default value = 0 "
^dispersalJumpv26 ifNil:[dispersalJumpv26 := 0]
dispersalJumpv26: anObject
dispersalJumpv26 := anObject
dispersalJumpv27
"Getter accessor with default value = 0 "
^dispersalJumpv27 ifNil:[dispersalJumpv27 := 0]
dispersalJumpv27: anObject
dispersalJumpv27 := anObject
dispersalJumpv28
"Getter accessor with default value = 0 "
^dispersalJumpv28 ifNil:[dispersalJumpv28 := 0]
dispersalJumpv28: anObject
dispersalJumpv28 := anObject
dispersalJumpv29
"Getter accessor with default value = 0 "
^dispersalJumpv29 ifNil:[dispersalJumpv29 := 0]
dispersalJumpv29: anObject
dispersalJumpv29 := anObject
dispersalJumpv30
"Getter accessor with default value = 0 "
^dispersalJumpv30 ifNil:[dispersalJumpv30 := 0]
dispersalJumpv30: anObject
dispersalJumpv30 := anObject
dispersalJumpv31
"Getter accessor with default value = 0 "
^dispersalJumpv31 ifNil:[dispersalJumpv31 := 0]
dispersalJumpv31: anObject
dispersalJumpv31 := anObject
dispersalJumpv32
"Getter accessor with default value = 0 "
^dispersalJumpv32 ifNil:[dispersalJumpv32 := 0]
dispersalJumpv32: anObject
dispersalJumpv32 := anObject
dispersalJumpv33
"Getter accessor with default value = 0 "
^dispersalJumpv33 ifNil:[dispersalJumpv33 := 0]
dispersalJumpv33: anObject
dispersalJumpv33 := anObject
dispersalJumpv34
"Getter accessor with default value = 0 "
^dispersalJumpv34 ifNil:[dispersalJumpv34 := 0]
dispersalJumpv34: anObject
dispersalJumpv34 := anObject
fecundityPhthorimaea
"US = fecundity layer"
"ES = Representa a una capa que según la temperatura va a guardar el numero de huevos por hembra (ecuación de la publicación de Olivier Dangles)"
^fecundityPhthorimaea ifNil:[fecundityPhthorimaea := 0]
fecundityPhthorimaea: anObject
fecundityPhthorimaea := anObject
fecunditySymmetrischemma
"US = fecundity layer"
"ES = Representa a una capa que según la temperatura va a guardar el numero de huevos por hembra (ecuación de la publicación de Olivier Dangles)"
^fecunditySymmetrischemma ifNil:[fecunditySymmetrischemma := 0]
fecunditySymmetrischemma: anObject
fecunditySymmetrischemma := anObject
fecundityTecia
"US = fecundity layer"
"ES = Representa a una capa que según la temperatura va a guardar el numero de huevos por hembra (ecuación de la publicación de Olivier Dangles)"
^fecundityTecia ifNil:[fecundityTecia := 0].
fecundityTecia: anObject
fecundityTecia := anObject
moveP
"US = buffer layer to store the pest diffusion cpabilities"
"ES = Representa la capa de las polillas adultas que potencialmente pueden dispersarse por difusión"
^moveP ifNil:[moveP := 0]
moveP: anObject
moveP := anObject
moveS
"US = buffer layer to store the pest diffusion cpabilities"
"ES = Representa la capa de las polillas adultas que potencialmente pueden dispersarse por difusión"
^moveS ifNil:[moveS := 0]
moveS: anObject
moveS := anObject
moveT
"US = buffer layer to store the pest diffusion cpabilities"
"ES = Representa la capa de las polillas adultas que potencialmente pueden dispersarse por difusión"
^moveT ifNil:[moveT := 0]
moveT: anObject
moveT := anObject
phthorimaea
"US = juveniles' layer"
"ES = Representa la capa de las polillas juveniles (del huevo a la larva)"
^phthorimaea ifNil:[phthorimaea := 0]
phthorimaea: anObject
phthorimaea := anObject
phthorimaeaAdults
"US = adults' layer"
"ES = Representa la capa de las polillas adultos"
^phthorimaeaAdults ifNil:[phthorimaeaAdults := 0]
phthorimaeaAdults: anObject
phthorimaeaAdults := anObject
phthorimaeaFemale
"US = gravid females' layer"
"ES = Representa la capa de las polillas hembras adultos"
^phthorimaeaFemale ifNil:[phthorimaeaFemale := 0]
phthorimaeaFemale: anObject
phthorimaeaFemale := anObject
pluvioAnual
"US = precipitations (not used in this model)"
"ES = pluvioAnual es una capa que representa la precipitación anual promedia en mm.
pluvioAnual no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^pluvioAnual ifNil:[pluvioAnual := 0]
pluvioAnual: anObject
pluvioAnual := anObject
population
"US = localisation of villages in the area studied (not used in this model)"
"ES = population es una capa que representa la population en los 34 pueblos mas grande del mapa.
population no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^population ifNil:[population := 0]
population: anObject
population := anObject
probe
"US = %pest which can move per saltation (LDD)"
"ES = Representa el porcentage de polillas que pueden hacer una dispersión por saltación"
^probe ifNil:[probe := 0.01]
probe: anObject
probe := anObject
qualityHabitat
"US = representation of the habitat quality considering resources for the pest"
"ES = Representa la capa de cuantidad de recurso tomando en cuenta el uso del suelo (agro) y la presencia de bodegas (bodega)"
^qualityHabitat ifNil:[qualityHabitat := 0]
qualityHabitat: anObject
qualityHabitat := anObject
rain1
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 1=enero"
^rain1 ifNil:[rain1 := 0]
rain10
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 10"
^rain10 ifNil:[rain10 := 0]
rain10: anObject
rain10 := anObject
rain11
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 11"
^rain11 ifNil:[rain11 := 0]
rain11: anObject
rain11 := anObject
rain12
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 12"
^rain12 ifNil:[rain12 := 0]
rain12: anObject
rain12 := anObject
rain1: anObject
rain1 := anObject
rain2
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 2"
^rain2 ifNil:[rain2 := 0]
rain2: anObject
rain2 := anObject
rain3
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 3"
^rain3 ifNil:[rain3 := 0]
rain3: anObject
rain3 := anObject
rain4
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 4"
^rain4 ifNil:[rain4 := 0]
rain4: anObject
rain4 := anObject
rain5
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 5"
^rain5 ifNil:[rain5 := 0]
rain5: anObject
rain5 := anObject
rain6
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 6"
^rain6 ifNil:[rain6 := 0]
rain6: anObject
rain6 := anObject
rain7
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 7"
^rain7 ifNil:[rain7 := 0]
rain7: anObject
rain7 := anObject
rain8
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 8"
^rain8 ifNil:[rain8 := 0]
rain8: anObject
rain8 := anObject
rain9
"US = precipitations (not used in this model)"
"ES = Precipitación promedia durante el mes 9"
^rain9 ifNil:[rain9 := 0]
rain9: anObject
rain9 := anObject
rainEffectAdults
"US = precipitations (not used in this model)"
"ES = Calcula el efecto de la precipitación en los adultos. Un mes aleatorio y el mes siguiente estan utilizados para que este factor cambia con cada generación, es decir que nunca va a ser el mismo efecto en las poblaciones de polilla. Las referencias utilisadas no son tan buenas y seria necesario añadir conocimiento gracias a bioensayos, pero resulta que este parámetro tiene muy poca incidencia en la dispersión y la supervivencia de las polillas. Resulta que no es necesario añadir mas conocimiento porque el nivel de precisión que tenemos con el modelo es suficiente en comparsión del uso que tenemos del modelo."
|x x2 r rEffect|
x := Cormas random.
x>=0 ifTrue: [ x<= 0.08333333 ifTrue: [x := 1]].
x> 0.08333333 ifTrue: [ x<=0.1666667 ifTrue: [x := 2]].
x> 0.1666667 ifTrue: [ x<=0.25 ifTrue: [x := 3]].
x> 0.25 ifTrue: [ x<=0.3333333 ifTrue: [x := 4]].
x> 0.3333333 ifTrue: [ x<=0.4166667 ifTrue: [x := 5]].
x> 0.4166667 ifTrue: [ x<=0.5 ifTrue: [x := 6]].
x> 0.5 ifTrue: [ x<=0.5833333 ifTrue: [x := 7]].
x> 0.5833333 ifTrue: [ x<=0.6666667 ifTrue: [x := 8]].
x> 0.6666667 ifTrue: [ x<=0.75 ifTrue: [x := 9]].
x> 0.75 ifTrue: [ x<=0.8333333 ifTrue: [x := 10]].
x> 0.8333333 ifTrue: [ x<=0.9166667 ifTrue: [x := 11]].
x> 0.9166667 ifTrue: [ x<=1 ifTrue: [x := 12]].
x2 := x + 1.
x2 = 13 ifTrue: [x2 := 1].
x = 1 ifTrue: [x :=rain1]
ifFalse: [x=2 ifTrue: [x :=rain2]
ifFalse: [x=3 ifTrue: [x :=rain3]
ifFalse: [x=4 ifTrue: [x :=rain4]
ifFalse: [x=5 ifTrue: [x :=rain5]
ifFalse: [x=6 ifTrue: [x :=rain6]
ifFalse: [x=7 ifTrue: [x :=rain7]
ifFalse: [x=8 ifTrue: [x :=rain8]
ifFalse: [x=9 ifTrue: [x :=rain9]
ifFalse: [x=10 ifTrue: [x :=rain10]
ifFalse: [x=11 ifTrue: [x :=rain11]
ifFalse: [x=12 ifTrue: [x :=rain12]
ifFalse: [x isNil ifTrue: [x :=1]] ]]]]]]]]]]].
x2 = 1 ifTrue: [x2 :=rain1]
ifFalse: [x2=2 ifTrue: [x2 :=rain2]
ifFalse: [x2=3 ifTrue: [x2 :=rain3]
ifFalse: [x2=4 ifTrue: [x2 :=rain4]
ifFalse: [x2=5 ifTrue: [x2 :=rain5]
ifFalse: [x2=6 ifTrue: [x2 :=rain6]
ifFalse: [x2=7 ifTrue: [x2 :=rain7]
ifFalse: [x2=8 ifTrue: [x2 :=rain8]
ifFalse: [x2=9 ifTrue: [x2 :=rain9]
ifFalse: [x2=10 ifTrue: [x2 :=rain10]
ifFalse: [x2=11 ifTrue: [x2 :=rain11]
ifFalse: [x2=12 ifTrue: [x2 :=rain12]
ifFalse: [x isNil ifTrue: [x :=1]] ]]]]]]]]]]].
x isNil ifTrue: [x :=1].
x2 isNil ifTrue: [x2 :=1].
r := (x + x2) * 6.
rEffect := (0-r)/40000000.
rEffect := rEffect * r.
rEffect := (rEffect)exp.
self rainEffectAdults: rEffect.
^rainEffectAdults ifNil:[rainEffectAdults := 1]
rainEffectAdults: anObject
rainEffectAdults := anObject
rainEffectJuveniles
"US = precipitations (not used in this model)"
"ES = Calcula el efecto de la precipitación en los juveniles. Un mes aleatorio y el mes siguiente estan utilizados para que este factor cambia con cada generación, es decir que nunca va a ser el mismo efecto en las poblaciones de polilla. Las referencias utilisadas no son tan buenas y seria necesario añadir conocimiento gracias a bioensayos, pero resulta que este parámetro tiene muy poca incidencia en la dispersión y la supervivencia de las polillas. Resulta que no es necesario añadir mas conocimiento porque el nivel de precisión que tenemos con el modelo es suficiente en comparsión del uso que tenemos del modelo. El efecto de las precipitaciones es distinto para los juveniles y los adultos"
|x x2 r rEffect|
x := Cormas random.
x>=0 ifTrue: [ x<= 0.08333333 ifTrue: [x := 1]].
x> 0.08333333 ifTrue: [ x<=0.1666667 ifTrue: [x := 2]].
x> 0.1666667 ifTrue: [ x<=0.25 ifTrue: [x := 3]].
x> 0.25 ifTrue: [ x<=0.3333333 ifTrue: [x := 4]].
x> 0.3333333 ifTrue: [ x<=0.4166667 ifTrue: [x := 5]].
x> 0.4166667 ifTrue: [ x<=0.5 ifTrue: [x := 6]].
x> 0.5 ifTrue: [ x<=0.5833333 ifTrue: [x := 7]].
x> 0.5833333 ifTrue: [ x<=0.6666667 ifTrue: [x := 8]].
x> 0.6666667 ifTrue: [ x<=0.75 ifTrue: [x := 9]].
x> 0.75 ifTrue: [ x<=0.8333333 ifTrue: [x := 10]].
x> 0.8333333 ifTrue: [ x<=0.9166667 ifTrue: [x := 11]].
x> 0.9166667 ifTrue: [ x<=1 ifTrue: [x := 12]].
x2 := x + 1.
x2 = 13 ifTrue: [x2 := 1].
x = 1 ifTrue: [x :=self rain1]
ifFalse: [x=2 ifTrue: [x :=self rain2]
ifFalse: [x=3 ifTrue: [x :=self rain3]
ifFalse: [x=4 ifTrue: [x :=self rain4]
ifFalse: [x=5 ifTrue: [x :=self rain5]
ifFalse: [x=6 ifTrue: [x :=self rain6]
ifFalse: [x=7 ifTrue: [x :=self rain7]
ifFalse: [x=8 ifTrue: [x :=self rain8]
ifFalse: [x=9 ifTrue: [x :=self rain9]
ifFalse: [x=10 ifTrue: [x :=self rain10]
ifFalse: [x=11 ifTrue: [x :=self rain11]
ifFalse: [x=12 ifTrue: [x :=self rain12]
ifFalse: [x isNil ifTrue: [x :=1]] ]]]]]]]]]]].
x2 = 1 ifTrue: [x2 :=self rain1]
ifFalse: [x2=2 ifTrue: [x2 :=self rain2]
ifFalse: [x2=3 ifTrue: [x2 :=self rain3]
ifFalse: [x2=4 ifTrue: [x2 :=self rain4]
ifFalse: [x2=5 ifTrue: [x2 :=self rain5]
ifFalse: [x2=6 ifTrue: [x2 :=self rain6]
ifFalse: [x2=7 ifTrue: [x2 :=self rain7]
ifFalse: [x2=8 ifTrue: [x2 :=self rain8]
ifFalse: [x2=9 ifTrue: [x2 :=self rain9]
ifFalse: [x2=10 ifTrue: [x2 :=self rain10]
ifFalse: [x2=11 ifTrue: [x2 :=self rain11]
ifFalse: [x2=12 ifTrue: [x2 :=self rain12]
ifFalse: [x isNil ifTrue: [x :=1]] ]]]]]]]]]]].
x isNil ifTrue: [x :=1].
x2 isNil ifTrue: [x :=1].
r := (x + x2) * 6.
rEffect := (0-r)/40000000.
rEffect := rEffect * r.
rEffect := (rEffect)exp.
self rainEffectJuveniles: rEffect.
^rainEffectJuveniles ifNil:[rainEffectJuveniles := 1]
rainEffectJuveniles: anObject
rainEffectJuveniles := anObject
rateLifePhthorimaea
"US = development time"
"ES = Representa el tiempo de desarollo de las polillas, es decir cuanto tiempo desde el huevo hasta el adulto. Es necesario para ajustar la fecundidad según las diferencias entre polillas."
^rateLifePhthorimaea ifNil:[rateLifePhthorimaea := 0]
rateLifePhthorimaea: anObject
rateLifePhthorimaea := anObject
rateLifeSymmetrischemma
"US = development time"
"ES = Representa el tiempo de desarollo de las polillas, es decir cuanto tiempo desde el huevo hasta el adulto. Es necesario para ajustar la fecundidad según las diferencias entre polillas."
^rateLifeSymmetrischemma ifNil:[rateLifeSymmetrischemma := 0]
rateLifeSymmetrischemma: anObject
rateLifeSymmetrischemma := anObject
rateLifeTecia
"US = development time"
"ES = Representa el tiempo de desarollo de las polillas, es decir cuanto tiempo desde el huevo hasta el adulto. Es necesario para ajustar la fecundidad según las diferencias entre polillas."
^rateLifeTecia ifNil:[rateLifeTecia := 0]
rateLifeTecia: anObject
rateLifeTecia := anObject
roads
"US = roads (not used)"
"ES = Representa la capa de las carreteras, que por el momento no es utilizado..."
^roads ifNil:[roads := 1]
roads: anObject
roads := anObject
rP
"US = corrected fecundity"
"ES = Representa la fecunidad (numero de huevos por hembra), con la corección del hecho que cada polilla tiene un tiempo de desarollo distinto según la temperatura."
^rP ifNil:[rP := 0.2]
rP: anObject
rP := anObject
rS
"US = corrected fecundity"
"ES = Representa la fecunidad (numero de huevos por hembra), con la corección del hecho que cada polilla tiene un tiempo de desarollo distinto según la temperatura."
^rS ifNil:[rS := 0.2]
rS: anObject
rS := anObject
rT
"US = corrected fecundity"
"ES = Representa la fecunidad (numero de huevos por hembra), con la corección del hecho que cada polilla tiene un tiempo de desarollo distinto según la temperatura."
^rT ifNil:[rT := 0.2]
rT: anObject
rT := anObject
stochastic
"US = stochastic adjustment of the temperature as sujested in the litterature"
| x1 x2 y1 y2 w t|
x1 := (2 * (Cormas random)) - 1.
x2 := (2 * (Cormas random)) - 1.
w := (x1 * x1) + (x2 * x2).
w<=1 ifTrue: [
w := ( ((0-2) * ((w)ln)) /w )sqrt.
y1 := x1 * w.
t := 0 - 2.
y1<=t ifTrue: [y1 := t].
y1>=2 ifTrue: [y1 := 2].
y2 := x2 * w.].
self stochastic: y1.
^stochastic ifNil: [stochastic := 0]
stochastic: anObject
stochastic := anObject
stoPec
^stoPec ifNil:[stoPec := 150]
stoPec2
^stoPec2 ifNil:[stoPec2 := 20]
stoPec2: anObject
stoPec2 := anObject
stoPec: anObject
stoPec := anObject
survivalRatePhthorimaea
"US = pest survival"
"ES = Representa la capa de supervivencia según la temperatura"
^survivalRatePhthorimaea ifNil:[survivalRatePhthorimaea := 0]
survivalRatePhthorimaea: anObject
survivalRatePhthorimaea := anObject
survivalRateSymmetrischemma
"US = pest survival"
"ES = Representa la capa de supervivencia según la temperatura"
^survivalRateSymmetrischemma ifNil:[survivalRateSymmetrischemma := 0]
survivalRateSymmetrischemma: anObject
survivalRateSymmetrischemma := anObject
survivalRateTecia
"US = pest survival"
"ES = Representa la capa de supervivencia según la temperatura"
^survivalRateTecia ifNil:[survivalRateTecia := 0]
survivalRateTecia: anObject
survivalRateTecia := anObject
symmetrischemaAdults
"US = pest adults"
"ES = Representa la capa de las polillas adultos"
^symmetrischemaAdults ifNil:[symmetrischemaAdults := 0]
symmetrischemaAdults: anObject
symmetrischemaAdults := anObject
symmetrischemaFemale
"US = pest gravid females"
"ES = Representa la capa de las polillas hembras adultos"
^symmetrischemaFemale ifNil:[symmetrischemaFemale := 0]
symmetrischemaFemale: anObject
symmetrischemaFemale := anObject
symmetrischemma
"US = pest juveniles"
"ES = Representa la capa de las polillas juveniles (del huevo a la larva)"
^symmetrischemma ifNil:[symmetrischemma := 0]
symmetrischemma: anObject
symmetrischemma := anObject
tecia
"US = pest juveniles"
"ES = Representa la capa de las polillas juveniles (del huevo a la larva)"
^tecia ifNil:[tecia := 0]
tecia: anObject
tecia := anObject.
self defineVisualState; show
teciaAdults
"US = pest adults"
"ES = Representa la capa de las polillas adultos"
^teciaAdults ifNil:[teciaAdults := 0]
teciaAdults: anObject
teciaAdults := anObject
teciaFemale
"US = pest gravid females"
"ES = Representa la capa de las polillas hembras adultos"
^teciaFemale ifNil:[teciaFemale := 0]
teciaFemale: anObject
teciaFemale := anObject
tempMaxi
"US = max(Temperature)"
"ES = tempMaxi es una capa que representa la temperatura promedia maxima en grados.
tempMaxi no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^tempMaxi ifNil:[tempMaxi := 0]
tempMaxi: anObject
tempMaxi := anObject
tempMini
"US = min(Temperature)"
"ES = tempMini es una capa que representa la temperatura promedia minima en grados.
tempMini no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^tempMini ifNil:[tempMini := 0]
tempMini: anObject
tempMini := anObject
tempPromedio
"US = mean(Temperature)"
"ES = tempPromedio es una capa que representa la temperatura promedia en grados.
tempPromedio no es generado por el modelo sino que viene de un mapa SIG, adentro del archivo *.env que inicia una simulación"
^tempPromedio ifNil:[tempPromedio := 0]
tempPromedio: anObject
tempPromedio := anObject
tempStochastic
"US = Temperature used in the model"
"ES = Representa la temperatura utilizada en el modelo que esta hecha a partir de la capa tempPromedio y de la capa stochastic"
^tempStochastic ifNil:[tempStochastic := 0]
tempStochastic: anObject
tempStochastic := anObject
village
"US = villages (not used in this model)"
"ES = Representa la capa de los pueblos, toma el valor 1 cuando hay un pueblo y 0 cuando no hay."
^village ifNil:[village := 0]
village2
"US = villages (not used in this model)"
"ES = Representa la capa de los pueblos, con un numero de 1 hasta 34 porque el modelo toma en cuenta los 34 mas grandes pueblos de la zona considerada."
^village2 ifNil:[village2 := 0]
village2: anObject
village2 := anObject
village: anObject
village := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Cell pov
povAgro
"GUI"
"US = land use"
"ES = Representamos en el mapa la capa agro. en verde tenemos las zonas de ciclo corto, es decir donde se puede que hay papas y en rojo las otras zonas como los parámos."
^super
povAttribute: #agro
minPalette:#(0 #red)
maxPalette:#(1 #green)
povAgroPart
^super
povAttribute: #agroPart
min:1
max:3
color: ColorValue red
povAgroPartPart
^super
povAttribute: #agroPartPart
min:1
max:18
color: ColorValue red
povAltura
"GUI"
"US = elevation"
"ES = Representa la capa de altura desde 0 m.s.n.m hasta 5000 m.s.n.m.. Las partes mas altas estan en maron y las partes mas bajas en verde."
^super
povAttribute: #altura
minPalette:#(0 #green)
maxPalette:#(5000 #brown)
povBodegas
"GUI"
"US = local stores"
"ES = Representa la capa de las bodegas. Cuando hay una bodega el punto esta en rojo y cuando no hay en blanco."
^super
povAttribute: #bodega
minPalette:#(0 #white)
maxPalette:#(1 #red)
povPluvioAnual
"GUI"
"US = precipitaions"
"ES = Representa la capa de las precipitaciones anuales. Los niveles se van desde 0 mm en blanco hasta 2500 mm en azul."
^super
povAttribute: #pluvioAnual
minPalette:#(0 #white)
maxPalette:#(2500 #blue)
povPopulation
"GUI"
"US = populations (not used in this model)"
"ES = Representa la capa de población. cuando no hay nadie la celda esta en blanca y se va hasta el marron cuando la población es alta. No hay diferencias para los pueblos de mas de 500 habitantes pero eso es unicamente visual."
^super
povAttribute: #population
minPalette:#(0 #white)
maxPalette:#(500 #brown)
povPTMPhthorimaeaAdults
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas adultas."
^super
povAttribute: #moveP
min: 0
max: 1000
color: ColorValue red
povPTMphthorimaeaFemale
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas hembras."
^super
povAttribute: #bufferNumberPhthorimaeaFemale
min: 0
max: 1000
color: ColorValue red
povPTMSymmetrischemaAdults
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas adultas."
^super
povAttribute: #moveS
min: 0
max: 1000
color: ColorValue blue
povPTMsymmetrischemaFemale
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas hembras."
^super
povAttribute: #bufferNumberSymmetrischemaFemale
min: 0
max: 1000
color: ColorValue blue
povPTMTeciaAdults
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas adultas."
^super
povAttribute: #moveT
min: 0
max: 1000
color: ColorValue green
povPTMteciaFemale
"GUI"
"US = %pest"
"ES = Representa el numero relativo de polillas hembras."
^super
povAttribute: #bufferNumberTeciaFemale
min: 0
max: 1000
color: ColorValue green
povQualityHabitat
"GUI"
"US = habitat quality considering resources"
"ES = Representa la cuantidad de recurso disponible en una celda."
^super
povAttribute: #qualityHabitat
minPalette:#(0 #red)
maxPalette:#(1 #green)
povRoads
"GUI"
"US = roads (not used)"
"ES = Representa la capa de las carreteras...ahora no esta incluido en el modelo."
^super
povAttribute: #roads
minPalette:#(0 #black)
maxPalette:#(1 #white)
povStochastic
"GUI"
"US = stochasticity over temperature"
"ES = Representa la capa de estochasticidad del modelo. Para que funcionna la estochasticidad del modelo sobre la temperatura, ES NECESARIO QUE ESTA CAPA SEA VISIBLE EN ELMODULO SPACE... es un bug que no logro areglar hasta ahora..."
^super
povAttribute: #stochastic
minPalette:#(-10 #green)
maxPalette:#(30 #red)
povTempMaxi
"GUI"
"US = Temperature"
"ES = Representa la capa de temperatura maxima."
^super
povAttribute: #tempMaxi
minPalette:#(-2 #blue)
maxPalette:#(25 #red)
povTempMini
"GUI"
"US = Temperature"
"ES = Representa la capa de temperatura minima."
^super
povAttribute: #tempMini
minPalette:#(-2 #blue)
maxPalette:#(25 #red)
povTempPromedio
"GUI"
"US = Temperature"
"ES = Representa la capa de temperatura promedia."
^super
povAttribute: #tempPromedio
minPalette:#(-2 #blue)
maxPalette:#(25 #red)
povTempStochastic
"GUI"
"US = Temperature"
"ES = Representa la capa de temperatura promedia cambiada con el factor de estochasticidad (es decir la capa stochastic)."
^super
povAttribute: #tempStochastic
minPalette:#(-2 #blue)
maxPalette:#(25 #red)
povVillages
"GUI"
"US = villages"
"ES = Representa la capa de los pueblos, con una celda azul si se encuentra un pueblo."
^super
povAttribute: #village
minPalette:#(0 #white)
maxPalette:#(1 #blue)
CormasNS.Models.SimPolillaSimiatug_v02.Cell control
step
self updateTempStochastic.
CormasNS.Models.SimPolillaSimiatug_v02.Cell modelIsolate
initVariablesIsolate
self rainEffectAdults: 1.
self rainEffectJuveniles: 1.
updateSurvivalRateIsolate
"US = pest survival using Dangles et al. and Rebaudo et al."
"ES = Regla para conocer la supervivencia de cada polilla según la temperatura"
| tempKelvinPromedio R aEgg bEgg cEgg dEgg eEgg fEgg aPupa bPupa cPupa dPupa ePupa fPupa aLarva bLarva cLarva dLarva eLarva fLarva survivalRateEggTecia survivalRateLarvaTecia survivalRatePupaTecia |
R := 1.987. "universal gas constant"
aEgg := 0.822.
bEgg := 0 - 758.5.
cEgg := 0 - 212100.
dEgg := 281.9.
eEgg := 405200.
fEgg := 303.8.
aLarva := 0.758.
bLarva := 0 - 180.2.
cLarva := 0 - 475700.
dLarva := 282.7.
eLarva := 1298000.
fLarva := 301.5.
aPupa := 0.9.
bPupa := 0 - 73.72.
cPupa := 0 - 1263000.
dPupa := 286.5.
ePupa := 1095000.
fPupa := 306.3.
tempKelvinPromedio := tempStochastic + 273.5.
survivalRateEggTecia := (((aEgg * tempKelvinPromedio) /298.16) *((((bEgg * ((1/298.16) - (1/tempKelvinPromedio))))) exp)) / (((((((1/dEgg) - (1/tempKelvinPromedio)) * cEgg) / R) exp) + 1) + (((((1/fEgg) - (1/tempKelvinPromedio)) * eEgg) / R) exp)).
survivalRateEggTecia <=0 ifTrue:[survivalRateEggTecia:=0].
survivalRateLarvaTecia := (((aLarva * tempKelvinPromedio) /298.16) *((((bLarva * ((1/298.16) - (1/tempKelvinPromedio))))) exp)) / (((((((1/dLarva) - (1/tempKelvinPromedio)) * cLarva) / R) exp) + 1) + (((((1/fLarva) - (1/tempKelvinPromedio)) * eLarva) / R) exp)).
survivalRateLarvaTecia <=0 ifTrue:[survivalRateLarvaTecia:=0].
survivalRatePupaTecia isNil ifTrue:[survivalRatePupaTecia:=1].
self survivalRateTecia: survivalRatePupaTecia * survivalRateLarvaTecia * survivalRateEggTecia.
self survivalRateTecia <0 ifTrue:[self survivalRateTecia: 0].
CormasNS.Models.SimPolillaSimiatug_v02.Cell model
bodegaEffect
"ES = Regla que pone una bodega mas donde hay un pueblo (1) y que modifica la temperatura según la presencia de bodega (2)"
"US = Rules which specify that if a village is present, therefore ther is at least one storage unit."
self altura<1800 ifTrue:[self agro:0].
"(1)"
self village=1 ifTrue:[self bodega:1].
self bodegaDensityA:0.
self bodegaDensityP:0.
self agro=1 ifTrue:[
self bodega isNil ifTrue:[
Cormas random<self bodegaDensityA ifTrue:[
self bodega: 1
]
ifFalse:[
self bodega: 0
]
]
].
self agro=0 ifTrue:[
self bodega isNil ifTrue:[
Cormas random<self bodegaDensityP ifTrue:[
self bodega: 1
]
ifFalse:[
self bodega: 0
]
]
].
"(2)"
self bodega=1 ifTrue:
[self tempPromedio>16 and: [Cormas random<0.5 ifTrue:
[self tempStochastic: 15]]].
self bodega=1 ifTrue:
[self tempPromedio<14 ifTrue:
[self tempStochastic: 15]].
constructAgroPart
self agro=0 ifTrue:[self agroPart: 0].
dieAllPTM
"US = rules regarding the moth survival: at the end of a generation, old moths die"
"ES = Despues de una generación, todas las polillas deben de morir. Solo se queda huevos (juveniles), de la proxima generación."
"el numero maximo de juveniles es de 2000. Si hay mas, se queda a 2000."
self tecia>2000 ifTrue:[self tecia: 2000].
self phthorimaea>2000 ifTrue:[self phthorimaea: 2000].
self symmetrischemma>2000 ifTrue:[self symmetrischemma: 2000].
"los adultos y/o hembras deben de morir"
self teciaAdults: 0.
self teciaFemale: 0.
self phthorimaeaAdults: 0.
self phthorimaeaFemale: 0.
self symmetrischemaAdults: 0.
self symmetrischemaFemale: 0.
"En las zonas donde no hay papas, hay poco recurso, añadimos este regla para que las polillas no pueden crusar un perimetro largo donde no hay papas (otro tipo de cultivo o paramo)"
self agro = 0 ifTrue:[self altura > 3500 ifTrue:[self tecia: self tecia*0.1] ifFalse:[self tecia: self tecia*0.001]].
self agro = 0 ifTrue:[self altura > 3500 ifTrue:[self phthorimaea: self phthorimaea*0.1] ifFalse:[self phthorimaea: self phthorimaea*0.001]].
self agro = 0 ifTrue:[self altura > 3500 ifTrue:[self symmetrischemma: self symmetrischemma*0.1] ifFalse:[self symmetrischemma: self symmetrischemma*0.001]].
diePTMAdults
"US = rules for the survival of the moths (adults)"
"ES = Regla que calcula la supervivencia de los adultos frente al nivel de predación, el efecto de las precipitaciones y el nivel de población de juveniles."
| predLevel predationAdults predationAdultsT predationAdultsP predationAdultsS |
"nivel minimo =10, nivel maximo =0, si 0, 0% de supervivencia"
predLevel := 10.
predationAdults := (1) - (((0 - predLevel) / 20) * predLevel)exp.
"adentro de una bodega no hay precipitaciones, entonces no hay efecto de la lluvia"
self bodega = 1 ifTrue:[self rainEffectAdults: 1].
"TECIA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
predationAdultsT := predationAdults.
self teciaAdults: self teciaAdults * self rainEffectAdults * predationAdultsT.
self moveT: self teciaAdults.
"PHTHORIMAEA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
predationAdultsP := predationAdults.
self phthorimaeaAdults: self phthorimaeaAdults * self rainEffectAdults * predationAdultsP.
self moveP: self phthorimaeaAdults.
"SYMMETRISCHEMA---------------------------------------------------------------------------------------------------------------------------------------------------------------------"
predationAdultsS := predationAdults.
self symmetrischemaAdults: self symmetrischemaAdults * self rainEffectAdults * predationAdultsS.
self moveS: self symmetrischemaAdults.
"---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
diePTMJuveniles
"US = rules for the survival of the moths (juveniles)"
"ES = Regla para que la capa juveniles sea vacia cuando los juveniles estan adultos. Tambien aplicamos reglas de supervivencia."
|probaSurvival forceOfMortalityInnate forceOfMortalityDispersalRelated forceOfMortalityNaturalEnemies|
"adentro de una bodega no hay precipitaciones, entonces no hay efecto de la lluvia"
self bodega = 1 ifTrue:[self rainEffectJuveniles: 1].
"No utilisamos forceOfMortalityInnate porque tomamaos este parametro en cuenta dentro de la supervivencia de los adultos.
Los datos vienen de una publicación de Olivier Roux y Johann Baugärtner en Ecological Modelling, 1998 : Evaluation of mortality factors and risk analysis for the design of en integrated pest management system."
"TECIA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
forceOfMortalityInnate:=0.016.
forceOfMortalityDispersalRelated:=0.060.
forceOfMortalityNaturalEnemies:=(0.129 + 0.162) / 2.
probaSurvival:= (0 - (("forceOfMortalityInnate + "forceOfMortalityDispersalRelated + forceOfMortalityNaturalEnemies)*5) ) exp.
self tecia ifNil:[self tecia: 0].
(self tecia: self tecia * probaSurvival * self survivalRateTecia * self rainEffectJuveniles).
(self teciaAdults: self tecia).
"PHTHORIMAEA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
forceOfMortalityInnate:=0.016.
forceOfMortalityDispersalRelated:=0.060.
forceOfMortalityNaturalEnemies:=(0.129 + 0.162) / 2.
probaSurvival:= (0 - (("forceOfMortalityInnate + "forceOfMortalityDispersalRelated + forceOfMortalityNaturalEnemies)*5) ) exp.
self phthorimaea ifNil:[self phthorimaea: 0].
(self phthorimaea: self phthorimaea *probaSurvival * self survivalRatePhthorimaea * self rainEffectJuveniles).
(self phthorimaeaAdults: self phthorimaea).
"SYMMETRISCHEMA---------------------------------------------------------------------------------------------------------------------------------------------------------------------"
forceOfMortalityInnate:=0.016.
forceOfMortalityDispersalRelated:=0.060.
forceOfMortalityNaturalEnemies:=(0.129 + 0.162) / 2.
probaSurvival:= (0 - (("forceOfMortalityInnate + "forceOfMortalityDispersalRelated + forceOfMortalityNaturalEnemies)*5) ) exp.
self symmetrischemma ifNil:[self symmetrischemma: 0].
(self symmetrischemma: self symmetrischemma *probaSurvival * self survivalRateSymmetrischemma * self rainEffectJuveniles).
(self symmetrischemaAdults: self symmetrischemma).
"---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
DispersalJumpPforAnalysis
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
"ES = Reglas de dispersión por saltación"
|dispersalJumpRate value01 x numMigre|
"Proporción de la población de la celda de origen que se va a dispersar por saltación."
dispersalJumpRate := 0.3.
"valor de seguridad por razon de programación"
value01:=0.
"Area alrejedor de un pueblo que puede ser contaminada por saltación. Por ejemplo si el pueblo es de 1000 habitantes, la saltación puede ocurir en las 10 celdas alrejedor de este pueblo. Rounded es para que el numero sea un integer"
x:= (self population/100) rounded.
"Si la area es inferior o igual a cero, entonces pongamos 1"
x<=0 ifTrue:[x := 1].
"Factor de división que hace morir una parte de la población que se dispersa."
numMigre := 2.
"si el pueblo es el pueblo numero 1, si un numero aleatorio entre 0 y 1 es mas pequeño que 0.1, si hay polillas, entonces guardamos en la capa dispersalJumpp01 la cuantidad de polilla que se puede dispersar por saltación. El numero de polillas en la celda es diminuido de las que se pueden ir. la capa dispersalJumpp01 corresponde a la area en la que se puede dispersar la polilla. Este numero es divido por NumMigre porque qlgunas se mueren durante el camino."
village2 = 1 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp01: self dispersalJumpp01 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp01: aCell dispersalJumpp01 + value01/numMigre].].].]. value01:=0.
village2 = 2 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp02: self dispersalJumpp02 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp02: aCell dispersalJumpp02 + value01/numMigre].].].]. value01:=0.
village2 = 3 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp03: self dispersalJumpp03 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp03: aCell dispersalJumpp03 + value01/numMigre].].].]. value01:=0.
village2 = 4 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp04: self dispersalJumpp04 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp04: aCell dispersalJumpp04 + value01/numMigre].].].]. value01:=0.
village2 = 5 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp05: self dispersalJumpp05 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp05: aCell dispersalJumpp05 + value01/numMigre].].].]. value01:=0.
village2 = 6 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp06: self dispersalJumpp06 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp06: aCell dispersalJumpp06 + value01/numMigre].].].]. value01:=0.
village2 = 7 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp07: self dispersalJumpp07 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp07: aCell dispersalJumpp07 + value01/numMigre].].].]. value01:=0.
village2 = 8 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp08: self dispersalJumpp08 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp08: aCell dispersalJumpp08 + value01/numMigre].].].]. value01:=0.
village2 = 9 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp09: self dispersalJumpp09 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp09: aCell dispersalJumpp09 + value01/numMigre].].].]. value01:=0.
village2 = 10 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp10: self dispersalJumpp10 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp10: aCell dispersalJumpp10 + value01/numMigre].].].]. value01:=0.
village2 = 11 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp11: self dispersalJumpp11 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp11: aCell dispersalJumpp11 + value01/numMigre].].].]. value01:=0.
village2 = 12 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp12: self dispersalJumpp12 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp12: aCell dispersalJumpp12 + value01/numMigre].].].]. value01:=0.
village2 = 13 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp13: self dispersalJumpp13 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp13: aCell dispersalJumpp13 + value01/numMigre].].].]. value01:=0.
village2 = 14 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp14: self dispersalJumpp14 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp14: aCell dispersalJumpp14 + value01/numMigre].].].]. value01:=0.
village2 = 15 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp15: self dispersalJumpp15 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp15: aCell dispersalJumpp15 + value01/numMigre].].].]. value01:=0.
village2 = 16 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp16: self dispersalJumpp16 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp16: aCell dispersalJumpp16 + value01/numMigre].].].]. value01:=0.
village2 = 17 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp17: self dispersalJumpp17 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp17: aCell dispersalJumpp17 + value01/numMigre].].].]. value01:=0.
village2 = 18 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp18: self dispersalJumpp18 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp18: aCell dispersalJumpp18 + value01/numMigre].].].]. value01:=0.
village2 = 19 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp19: self dispersalJumpp19 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp19: aCell dispersalJumpp19 + value01/numMigre].].].]. value01:=0.
village2 = 20 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp20: self dispersalJumpp20 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp20: aCell dispersalJumpp20 + value01/numMigre].].].]. value01:=0.
village2 = 21 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp21: self dispersalJumpp21 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp21: aCell dispersalJumpp21 + value01/numMigre].].].]. value01:=0.
village2 = 22 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp22: self dispersalJumpp22 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp22: aCell dispersalJumpp22 + value01/numMigre].].].]. value01:=0.
village2 = 23 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp23: self dispersalJumpp23 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp23: aCell dispersalJumpp23 + value01/numMigre].].].]. value01:=0.
village2 = 24 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp24: self dispersalJumpp24 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp24: aCell dispersalJumpp24 + value01/numMigre].].].]. value01:=0.
village2 = 25 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp25: self dispersalJumpp25 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp25: aCell dispersalJumpp25 + value01/numMigre].].].]. value01:=0.
village2 = 26 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp26: self dispersalJumpp26 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp26: aCell dispersalJumpp26 + value01/numMigre].].].]. value01:=0.
village2 = 27 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp27: self dispersalJumpp27 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp27: aCell dispersalJumpp27 + value01/numMigre].].].]. value01:=0.
village2 = 28 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp28: self dispersalJumpp28 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp28: aCell dispersalJumpp28 + value01/numMigre].].].]. value01:=0.
village2 = 29 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp29: self dispersalJumpp29 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp29: aCell dispersalJumpp29 + value01/numMigre].].].]. value01:=0.
village2 = 30 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp30: self dispersalJumpp30 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp30: aCell dispersalJumpp30 + value01/numMigre].].].]. value01:=0.
village2 = 31 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp31: self dispersalJumpp31 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp31: aCell dispersalJumpp31 + value01/numMigre].].].]. value01:=0.
village2 = 32 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp32: self dispersalJumpp32 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp32: aCell dispersalJumpp32 + value01/numMigre].].].]. value01:=0.
village2 = 33 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp33: self dispersalJumpp33 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp33: aCell dispersalJumpp33 + value01/numMigre].].].]. value01:=0.
village2 = 34 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self phthorimaeaAdults>0 ifTrue: [self dispersalJumpp34: self dispersalJumpp34 - (phthorimaeaAdults * dispersalJumpRate). self phthorimaeaAdults: self phthorimaeaAdults - (phthorimaeaAdults * dispersalJumpRate). value01:= (phthorimaeaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpp34: aCell dispersalJumpp34 + value01/numMigre].].].]. value01:=0.
DispersalJumpSforAnalysis
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
|dispersalJumpRate value01 x numMigre|
dispersalJumpRate := 0.3.
value01:=0.
x:= (self population/100) rounded.
x<=0 ifTrue:[x := 1].
numMigre := 2.
village2 = 1 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps01: self dispersalJumps01 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps01: aCell dispersalJumps01 + value01/numMigre].].].]. value01:=0.
village2 = 2 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps02: self dispersalJumps02 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps02: aCell dispersalJumps02 + value01/numMigre].].].]. value01:=0.
village2 = 3 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps03: self dispersalJumps03 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps03: aCell dispersalJumps03 + value01/numMigre].].].]. value01:=0.
village2 = 4 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps04: self dispersalJumps04 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps04: aCell dispersalJumps04 + value01/numMigre].].].]. value01:=0.
village2 = 5 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps05: self dispersalJumps05 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps05: aCell dispersalJumps05 + value01/numMigre].].].]. value01:=0.
village2 = 6 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps06: self dispersalJumps06 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps06: aCell dispersalJumps06 + value01/numMigre].].].]. value01:=0.
village2 = 7 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps07: self dispersalJumps07 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps07: aCell dispersalJumps07 + value01/numMigre].].].]. value01:=0.
village2 = 8 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps08: self dispersalJumps08 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps08: aCell dispersalJumps08 + value01/numMigre].].].]. value01:=0.
village2 = 9 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps09: self dispersalJumps09 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps09: aCell dispersalJumps09 + value01/numMigre].].].]. value01:=0.
village2 = 10 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps10: self dispersalJumps10 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps10: aCell dispersalJumps10 + value01/numMigre].].].]. value01:=0.
village2 = 11 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps11: self dispersalJumps11 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps11: aCell dispersalJumps11 + value01/numMigre].].].]. value01:=0.
village2 = 12 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps12: self dispersalJumps12 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps12: aCell dispersalJumps12 + value01/numMigre].].].]. value01:=0.
village2 = 13 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps13: self dispersalJumps13 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps13: aCell dispersalJumps13 + value01/numMigre].].].]. value01:=0.
village2 = 14 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps14: self dispersalJumps14 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps14: aCell dispersalJumps14 + value01/numMigre].].].]. value01:=0.
village2 = 15 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps15: self dispersalJumps15 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps15: aCell dispersalJumps15 + value01/numMigre].].].]. value01:=0.
village2 = 16 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps16: self dispersalJumps16 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps16: aCell dispersalJumps16 + value01/numMigre].].].]. value01:=0.
village2 = 17 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps17: self dispersalJumps17 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps17: aCell dispersalJumps17 + value01/numMigre].].].]. value01:=0.
village2 = 18 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps18: self dispersalJumps18 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps18: aCell dispersalJumps18 + value01/numMigre].].].]. value01:=0.
village2 = 19 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps19: self dispersalJumps19 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps19: aCell dispersalJumps19 + value01/numMigre].].].]. value01:=0.
village2 = 20 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps20: self dispersalJumps20 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps20: aCell dispersalJumps20 + value01/numMigre].].].]. value01:=0.
village2 = 21 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps21: self dispersalJumps21 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps21: aCell dispersalJumps21 + value01/numMigre].].].]. value01:=0.
village2 = 22 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps22: self dispersalJumps22 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps22: aCell dispersalJumps22 + value01/numMigre].].].]. value01:=0.
village2 = 23 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps23: self dispersalJumps23 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps23: aCell dispersalJumps23 + value01/numMigre].].].]. value01:=0.
village2 = 24 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps24: self dispersalJumps24 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps24: aCell dispersalJumps24 + value01/numMigre].].].]. value01:=0.
village2 = 25 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps25: self dispersalJumps25 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps25: aCell dispersalJumps25 + value01/numMigre].].].]. value01:=0.
village2 = 26 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps26: self dispersalJumps26 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps26: aCell dispersalJumps26 + value01/numMigre].].].]. value01:=0.
village2 = 27 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps27: self dispersalJumps27 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps27: aCell dispersalJumps27 + value01/numMigre].].].]. value01:=0.
village2 = 28 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps28: self dispersalJumps28 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps28: aCell dispersalJumps28 + value01/numMigre].].].]. value01:=0.
village2 = 29 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps29: self dispersalJumps29 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps29: aCell dispersalJumps29 + value01/numMigre].].].]. value01:=0.
village2 = 30 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps30: self dispersalJumps30 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps30: aCell dispersalJumps30 + value01/numMigre].].].]. value01:=0.
village2 = 31 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps31: self dispersalJumps31 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps31: aCell dispersalJumps31 + value01/numMigre].].].]. value01:=0.
village2 = 32 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps32: self dispersalJumps32 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps32: aCell dispersalJumps32 + value01/numMigre].].].]. value01:=0.
village2 = 33 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps33: self dispersalJumps33 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps33: aCell dispersalJumps33 + value01/numMigre].].].]. value01:=0.
village2 = 34 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self symmetrischemaAdults>0 ifTrue: [self dispersalJumps34: self dispersalJumps34 - (symmetrischemaAdults * dispersalJumpRate). self symmetrischemaAdults: self symmetrischemaAdults - (symmetrischemaAdults * dispersalJumpRate). value01:= (symmetrischemaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumps34: aCell dispersalJumps34 + value01/numMigre].].].]. value01:=0.
DispersalJumpTforAnalysis
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
|dispersalJumpRate value01 x numMigre|
dispersalJumpRate := 0.3.
value01:=0.
x:= (self population/100) rounded.
x<=0 ifTrue:[x := 1].
numMigre := 2.
village2 = 1 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv01: self dispersalJumpv01 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv01: aCell dispersalJumpv01 + value01/numMigre].].].]. value01:=0.
village2 = 2 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv02: self dispersalJumpv02 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv02: aCell dispersalJumpv02 + value01/numMigre].].].]. value01:=0.
village2 = 3 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv03: self dispersalJumpv03 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv03: aCell dispersalJumpv03 + value01/numMigre].].].]. value01:=0.
village2 = 4 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv04: self dispersalJumpv04 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv04: aCell dispersalJumpv04 + value01/numMigre].].].]. value01:=0.
village2 = 5 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv05: self dispersalJumpv05 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv05: aCell dispersalJumpv05 + value01/numMigre].].].]. value01:=0.
village2 = 6 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv06: self dispersalJumpv06 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv06: aCell dispersalJumpv06 + value01/numMigre].].].]. value01:=0.
village2 = 7 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv07: self dispersalJumpv07 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv07: aCell dispersalJumpv07 + value01/numMigre].].].]. value01:=0.
village2 = 8 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv08: self dispersalJumpv08 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv08: aCell dispersalJumpv08 + value01/numMigre].].].]. value01:=0.
village2 = 9 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv09: self dispersalJumpv09 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv09: aCell dispersalJumpv09 + value01/numMigre].].].]. value01:=0.
village2 = 10 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv10: self dispersalJumpv10 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv10: aCell dispersalJumpv10 + value01/numMigre].].].]. value01:=0.
village2 = 11 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv11: self dispersalJumpv11 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv11: aCell dispersalJumpv11 + value01/numMigre].].].]. value01:=0.
village2 = 12 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv12: self dispersalJumpv12 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv12: aCell dispersalJumpv12 + value01/numMigre].].].]. value01:=0.
village2 = 13 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv13: self dispersalJumpv13 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv13: aCell dispersalJumpv13 + value01/numMigre].].].]. value01:=0.
village2 = 14 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv14: self dispersalJumpv14 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv14: aCell dispersalJumpv14 + value01/numMigre].].].]. value01:=0.
village2 = 15 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv15: self dispersalJumpv15 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv15: aCell dispersalJumpv15 + value01/numMigre].].].]. value01:=0.
village2 = 16 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv16: self dispersalJumpv16 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv16: aCell dispersalJumpv16 + value01/numMigre].].].]. value01:=0.
village2 = 17 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv17: self dispersalJumpv17 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv17: aCell dispersalJumpv17 + value01/numMigre].].].]. value01:=0.
village2 = 18 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv18: self dispersalJumpv18 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv18: aCell dispersalJumpv18 + value01/numMigre].].].]. value01:=0.
village2 = 19 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv19: self dispersalJumpv19 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv19: aCell dispersalJumpv19 + value01/numMigre].].].]. value01:=0.
village2 = 20 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv20: self dispersalJumpv20 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv20: aCell dispersalJumpv20 + value01/numMigre].].].]. value01:=0.
village2 = 21 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv21: self dispersalJumpv21 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv21: aCell dispersalJumpv21 + value01/numMigre].].].]. value01:=0.
village2 = 22 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv22: self dispersalJumpv22 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv22: aCell dispersalJumpv22 + value01/numMigre].].].]. value01:=0.
village2 = 23 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv23: self dispersalJumpv23 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv23: aCell dispersalJumpv23 + value01/numMigre].].].]. value01:=0.
village2 = 24 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv24: self dispersalJumpv24 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv24: aCell dispersalJumpv24 + value01/numMigre].].].]. value01:=0.
village2 = 25 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv25: self dispersalJumpv25 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv25: aCell dispersalJumpv25 + value01/numMigre].].].]. value01:=0.
village2 = 26 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv26: self dispersalJumpv26 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv26: aCell dispersalJumpv26 + value01/numMigre].].].]. value01:=0.
village2 = 27 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv27: self dispersalJumpv27 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv27: aCell dispersalJumpv27 + value01/numMigre].].].]. value01:=0.
village2 = 28 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv28: self dispersalJumpv28 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv28: aCell dispersalJumpv28 + value01/numMigre].].].]. value01:=0.
village2 = 29 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv29: self dispersalJumpv29 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv29: aCell dispersalJumpv29 + value01/numMigre].].].]. value01:=0.
village2 = 30 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv30: self dispersalJumpv30 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv30: aCell dispersalJumpv30 + value01/numMigre].].].]. value01:=0.
village2 = 31 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv31: self dispersalJumpv31 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv31: aCell dispersalJumpv31 + value01/numMigre].].].]. value01:=0.
village2 = 32 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv32: self dispersalJumpv32 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv32: aCell dispersalJumpv32 + value01/numMigre].].].]. value01:=0.
village2 = 33 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv33: self dispersalJumpv33 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv33: aCell dispersalJumpv33 + value01/numMigre].].].]. value01:=0.
village2 = 34 ifTrue: [(Cormas randomFrom: 0 to: self population) < (self population*0.1) ifTrue: [self teciaAdults>0 ifTrue: [self dispersalJumpv34: self dispersalJumpv34 - (teciaAdults * dispersalJumpRate). self teciaAdults: self teciaAdults - (teciaAdults * dispersalJumpRate). value01:= (teciaAdults * dispersalJumpRate). (self recursiveNeighbourhood: x) do: [:aCell | aCell dispersalJumpv34: aCell dispersalJumpv34 + value01/numMigre].].].]. value01:=0.
DispersalJumpUpdateP
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
"ES = Regla que finaliza la dispersión por saltación"
|SUMdispersalJumpp01 SUMdispersalJumpp02 SUMdispersalJumpp03 SUMdispersalJumpp04 SUMdispersalJumpp05 SUMdispersalJumpp06 SUMdispersalJumpp07 SUMdispersalJumpp08 SUMdispersalJumpp09 SUMdispersalJumpp10 SUMdispersalJumpp11 SUMdispersalJumpp12 SUMdispersalJumpp13 SUMdispersalJumpp14 SUMdispersalJumpp15 SUMdispersalJumpp16 SUMdispersalJumpp17 SUMdispersalJumpp18 SUMdispersalJumpp19 SUMdispersalJumpp20 SUMdispersalJumpp21 SUMdispersalJumpp22 SUMdispersalJumpp23 SUMdispersalJumpp24 SUMdispersalJumpp25 SUMdispersalJumpp26 SUMdispersalJumpp27 SUMdispersalJumpp28 SUMdispersalJumpp29 SUMdispersalJumpp30 SUMdispersalJumpp31 SUMdispersalJumpp32 SUMdispersalJumpp33 SUMdispersalJumpp34|
"Probabilidad de establecimiento de 1%"
"self probe: 0.01."
SUMdispersalJumpp01 := self dispersalJumpp01.
SUMdispersalJumpp02 := self dispersalJumpp02.
SUMdispersalJumpp03 := self dispersalJumpp03.
SUMdispersalJumpp04 := self dispersalJumpp04.
SUMdispersalJumpp05 := self dispersalJumpp05.
SUMdispersalJumpp06 := self dispersalJumpp06.
SUMdispersalJumpp07 := self dispersalJumpp07.
SUMdispersalJumpp08 := self dispersalJumpp08.
SUMdispersalJumpp09 := self dispersalJumpp09.
SUMdispersalJumpp10 := self dispersalJumpp10.
SUMdispersalJumpp11 := self dispersalJumpp11.
SUMdispersalJumpp12 := self dispersalJumpp12.
SUMdispersalJumpp13 := self dispersalJumpp13.
SUMdispersalJumpp14 := self dispersalJumpp14.
SUMdispersalJumpp15 := self dispersalJumpp15.
SUMdispersalJumpp16 := self dispersalJumpp16.
SUMdispersalJumpp17 := self dispersalJumpp17.
SUMdispersalJumpp18 := self dispersalJumpp18.
SUMdispersalJumpp19 := self dispersalJumpp19.
SUMdispersalJumpp20 := self dispersalJumpp20.
SUMdispersalJumpp21 := self dispersalJumpp21.
SUMdispersalJumpp22 := self dispersalJumpp22.
SUMdispersalJumpp23 := self dispersalJumpp23.
SUMdispersalJumpp24 := self dispersalJumpp24.
SUMdispersalJumpp25 := self dispersalJumpp25.
SUMdispersalJumpp26 := self dispersalJumpp26.
SUMdispersalJumpp27 := self dispersalJumpp27.
SUMdispersalJumpp28 := self dispersalJumpp28.
SUMdispersalJumpp29 := self dispersalJumpp29.
SUMdispersalJumpp30 := self dispersalJumpp30.
SUMdispersalJumpp31 := self dispersalJumpp31.
SUMdispersalJumpp32 := self dispersalJumpp32.
SUMdispersalJumpp33 := self dispersalJumpp33.
SUMdispersalJumpp34 := self dispersalJumpp34.
"Hay una probabilidad de establecimiento de probe% (ahora 1%), para cada celda de la area de saltación posible."
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp01. self dispersalJumpp01: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp02. self dispersalJumpp02: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp03. self dispersalJumpp03: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp04. self dispersalJumpp04: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp05. self dispersalJumpp05: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp06. self dispersalJumpp06: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp07. self dispersalJumpp07: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp08. self dispersalJumpp08: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp09. self dispersalJumpp09: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp10. self dispersalJumpp10: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp11. self dispersalJumpp11: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp12. self dispersalJumpp12: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp13. self dispersalJumpp13: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp14. self dispersalJumpp14: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp15. self dispersalJumpp15: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp16. self dispersalJumpp16: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp17. self dispersalJumpp17: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp18. self dispersalJumpp18: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp19. self dispersalJumpp19: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp20. self dispersalJumpp20: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp21. self dispersalJumpp21: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp22. self dispersalJumpp22: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp23. self dispersalJumpp23: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp24. self dispersalJumpp24: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp25. self dispersalJumpp25: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp26. self dispersalJumpp26: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp27. self dispersalJumpp27: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp28. self dispersalJumpp28: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp29. self dispersalJumpp29: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp30. self dispersalJumpp30: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp31. self dispersalJumpp31: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp32. self dispersalJumpp32: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp33. self dispersalJumpp33: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self phthorimaeaAdults: self phthorimaeaAdults + SUMdispersalJumpp34. self dispersalJumpp34: 0.].
DispersalJumpUpdateS
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
|SUMdispersalJumps01 SUMdispersalJumps02 SUMdispersalJumps03 SUMdispersalJumps04 SUMdispersalJumps05 SUMdispersalJumps06 SUMdispersalJumps07 SUMdispersalJumps08 SUMdispersalJumps09 SUMdispersalJumps10 SUMdispersalJumps11 SUMdispersalJumps12 SUMdispersalJumps13 SUMdispersalJumps14 SUMdispersalJumps15 SUMdispersalJumps16 SUMdispersalJumps17 SUMdispersalJumps18 SUMdispersalJumps19 SUMdispersalJumps20 SUMdispersalJumps21 SUMdispersalJumps22 SUMdispersalJumps23 SUMdispersalJumps24 SUMdispersalJumps25 SUMdispersalJumps26 SUMdispersalJumps27 SUMdispersalJumps28 SUMdispersalJumps29 SUMdispersalJumps30 SUMdispersalJumps31 SUMdispersalJumps32 SUMdispersalJumps33 SUMdispersalJumps34|
"self probe:0.01."
SUMdispersalJumps01 := self dispersalJumps01.
SUMdispersalJumps02 := self dispersalJumps02.
SUMdispersalJumps03 := self dispersalJumps03.
SUMdispersalJumps04 := self dispersalJumps04.
SUMdispersalJumps05 := self dispersalJumps05.
SUMdispersalJumps06 := self dispersalJumps06.
SUMdispersalJumps07 := self dispersalJumps07.
SUMdispersalJumps08 := self dispersalJumps08.
SUMdispersalJumps09 := self dispersalJumps09.
SUMdispersalJumps10 := self dispersalJumps10.
SUMdispersalJumps11 := self dispersalJumps11.
SUMdispersalJumps12 := self dispersalJumps12.
SUMdispersalJumps13 := self dispersalJumps13.
SUMdispersalJumps14 := self dispersalJumps14.
SUMdispersalJumps15 := self dispersalJumps15.
SUMdispersalJumps16 := self dispersalJumps16.
SUMdispersalJumps17 := self dispersalJumps17.
SUMdispersalJumps18 := self dispersalJumps18.
SUMdispersalJumps19 := self dispersalJumps19.
SUMdispersalJumps20 := self dispersalJumps20.
SUMdispersalJumps21 := self dispersalJumps21.
SUMdispersalJumps22 := self dispersalJumps22.
SUMdispersalJumps23 := self dispersalJumps23.
SUMdispersalJumps24 := self dispersalJumps24.
SUMdispersalJumps25 := self dispersalJumps25.
SUMdispersalJumps26 := self dispersalJumps26.
SUMdispersalJumps27 := self dispersalJumps27.
SUMdispersalJumps28 := self dispersalJumps28.
SUMdispersalJumps29 := self dispersalJumps29.
SUMdispersalJumps30 := self dispersalJumps30.
SUMdispersalJumps31 := self dispersalJumps31.
SUMdispersalJumps32 := self dispersalJumps32.
SUMdispersalJumps33 := self dispersalJumps33.
SUMdispersalJumps34 := self dispersalJumps34.
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps01. self dispersalJumps01: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps02. self dispersalJumps02: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps03. self dispersalJumps03: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps04. self dispersalJumps04: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps05. self dispersalJumps05: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps06. self dispersalJumps06: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps07. self dispersalJumps07: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps08. self dispersalJumps08: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps09. self dispersalJumps09: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps10. self dispersalJumps10: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps11. self dispersalJumps11: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps12. self dispersalJumps12: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps13. self dispersalJumps13: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps14. self dispersalJumps14: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps15. self dispersalJumps15: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps16. self dispersalJumps16: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps17. self dispersalJumps17: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps18. self dispersalJumps18: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps19. self dispersalJumps19: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps20. self dispersalJumps20: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps21. self dispersalJumps21: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps22. self dispersalJumps22: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps23. self dispersalJumps23: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps24. self dispersalJumps24: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps25. self dispersalJumps25: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps26. self dispersalJumps26: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps27. self dispersalJumps27: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps28. self dispersalJumps28: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps29. self dispersalJumps29: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps30. self dispersalJumps30: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps31. self dispersalJumps31: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps32. self dispersalJumps32: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps33. self dispersalJumps33: 0.].
(Cormas randomFrom: 0 to: self population) < (self population*self probe) ifTrue: [self symmetrischemaAdults: self symmetrischemaAdults + SUMdispersalJumps34. self dispersalJumps34: 0.].
DispersalJumpUpdateT
"US = rules for the long distance dispersal (not used in the ABM at the scale considered)"
|SUMdispersalJumpv01 SUMdispersalJumpv02 SUMdispersalJumpv03 SUMdispersalJumpv04 SUMdispersalJumpv05 SUMdispersalJumpv06 SUMdispersalJumpv07 SUMdispersalJumpv08 SUMdispersalJumpv09 SUMdispersalJumpv10 SUMdispersalJumpv11 SUMdispersalJumpv12 SUMdispersalJumpv13 SUMdispersalJumpv14 SUMdispersalJumpv15 SUMdispersalJumpv16 SUMdispersalJumpv17 SUMdispersalJumpv18 SUMdispersalJumpv19 SUMdispersalJumpv20 SUMdispersalJumpv21 SUMdispersalJumpv22 SUMdispersalJumpv23 SUMdispersalJumpv24 SUMdispersalJumpv25 SUMdispersalJumpv26 SUMdispersalJumpv27 SUMdispersalJumpv28 SUMdispersalJumpv29 SUMdispersalJumpv30 SUMdispersalJumpv31 SUMdispersalJumpv32 SUMdispersalJumpv33 SUMdispersalJumpv34 |
"self probe:0.01."
SUMdispersalJumpv01 := self dispersalJumpv01.
SUMdispersalJumpv02 := self dispersalJumpv02.
SUMdispersalJumpv03 := self dispersalJumpv03.
SUMdispersalJumpv04 := self dispersalJumpv04.
SUMdispersalJumpv05 := self dispersalJumpv05.
SUMdispersalJumpv06 := self dispersalJumpv06.
SUMdispersalJumpv07 := self dispersalJumpv07.
SUMdispersalJumpv08 := self dispersalJumpv08.
SUMdispersalJumpv09 := self dispersalJumpv09.
SUMdispersalJumpv10 := self dispersalJumpv10.
SUMdispersalJumpv11 := self dispersalJumpv11.
SUMdispersalJumpv12 := self dispersalJumpv12.
SUMdispersalJumpv13 := self dispersalJumpv13.
SUMdispersalJumpv14 := self dispersalJumpv14.
SUMdispersalJumpv15 := self dispersalJumpv15.
SUMdispersalJumpv16 := self dispersalJumpv16.
SUMdispersalJumpv17 := self dispersalJumpv17.
SUMdispersalJumpv18 := self dispersalJumpv18.
SUMdispersalJumpv19 := self dispersalJumpv19.
SUMdispersalJumpv20 := self dispersalJumpv20.
SUMdispersalJumpv21 := self dispersalJumpv21.
SUMdispersalJumpv22 := self dispersalJumpv22.
SUMdispersalJumpv23 := self dispersalJumpv23.
SUMdispersalJumpv24 := self dispersalJumpv24.
SUMdispersalJumpv25 := self dispersalJumpv25.
SUMdispersalJumpv26 := self dispersalJumpv26.
SUMdispersalJumpv27 := self dispersalJumpv27.
SUMdispersalJumpv28 := self dispersalJumpv28.
SUMdispersalJumpv29 := self dispersalJumpv29.
SUMdispersalJumpv30 := self dispersalJumpv30.
SUMdispersalJumpv31 := self dispersalJumpv31.
SUMdispersalJumpv32 := self dispersalJumpv32.
SUMdispersalJumpv33 := self dispersalJumpv33.
SUMdispersalJumpv34 := self dispersalJumpv34.
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv01. self dispersalJumpv01: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv02. self dispersalJumpv02: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv03. self dispersalJumpv03: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv04. self dispersalJumpv04: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv05. self dispersalJumpv05: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv06. self dispersalJumpv06: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv07. self dispersalJumpv07: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv08. self dispersalJumpv08: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv09. self dispersalJumpv09: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv10. self dispersalJumpv10: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv11. self dispersalJumpv11: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv12. self dispersalJumpv12: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv13. self dispersalJumpv13: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv14. self dispersalJumpv14: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv15. self dispersalJumpv15: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv16. self dispersalJumpv16: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv17. self dispersalJumpv17: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv18. self dispersalJumpv18: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv19. self dispersalJumpv19: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv20. self dispersalJumpv20: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv21. self dispersalJumpv21: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv22. self dispersalJumpv22: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv23. self dispersalJumpv23: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv24. self dispersalJumpv24: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv25. self dispersalJumpv25: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv26. self dispersalJumpv26: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv27. self dispersalJumpv27: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv28. self dispersalJumpv28: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv29. self dispersalJumpv29: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv30. self dispersalJumpv30: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv31. self dispersalJumpv31: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv32. self dispersalJumpv32: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv33. self dispersalJumpv33: 0.].
(Cormas randomFrom: 0 to: self population) < (self population* self probe) ifTrue: [self teciaAdults: self teciaAdults + SUMdispersalJumpv34. self dispersalJumpv34: 0.].
initVariables
self rainEffectAdults isNil ifTrue:[self rainEffectAdults: 1].
self rainEffectJuveniles isNil ifTrue:[self rainEffectJuveniles: 1].
movePTM_exp
"US = rules for the dispersion of the moth by diffusion"
"ES = Regla de dispersión por difusión (distancia de vuelo)"
| yd distance ye numMigre longCell yeReal surface dispersal yeReal500 yeReal200 yeReal150 yeReal100 yeReal75 yeReal50 yeReal25 yeReal10 yeReal5 yeReal1 K a|
"Factor de la curva de distancia de vuelo"
a:=0.015.
"Probabilidad de dispersión según el numero de individuos y la cuantidad de recurso"
K :=1000.
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveT-(K-200)) )exp) ))* (1-qualityHabitat).
"Numero de individuos que se van a dispersar por difusión"
numMigre := ye * self moveT.
"Datos de una celda (que hace 500 * 500 m)"
longCell := 500.
surface := longCell * longCell.
"Porcentage de la población que se va de 250m hasta 499m"
distance := (Cormas randomFrom: 250 to: 499).
yd := ((0 - a) * distance) exp.
"Probabilidad de irse de una celda con este rango de distancia (en este caso dicemos 100% porque suponemos que la polilla se va recto y que elige el camino mas corto para salir de una celda)"
yeReal := 1.
"Parte de la población que finalmente se va a dispersar por difusión afuera de su celda con este distancia"
yeReal500 := yd * yeReal.
distance := (Cormas randomFrom: 200 to: 249).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
"Cuantidad de polillas que se dispersen por difusión afuera de su celda"
dispersal := (yeReal500 + yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
"Eliminamos de la celda inicial las polillas ques se van"
self bufferTecia: self bufferTecia - dispersal.
"Repartimos las polillas que se van en las 4 celdas alrejedor de la celda inicial (en una capa aparte aue utilizamos despues para la actualización)"
self neighbourhood do: [:aCell | aCell bufferTecia: aCell bufferTecia + (dispersal / self neighbourhood size)].
"----------------------------------------------------------------------------------------------------------------------------------------------------------"
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveP-(K-200)) )exp) ))* (1-qualityHabitat).
numMigre := ye * self moveP.
distance := (Cormas randomFrom: 250 to: 499).
yd := ((0 - a) * distance) exp.
yeReal := 1.
yeReal500 := yd * yeReal.
distance := (Cormas randomFrom: 200 to: 249).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
dispersal := (yeReal500 +yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
self bufferPhthorimaea: self bufferPhthorimaea - dispersal.
self neighbourhood do: [:aCell | aCell bufferPhthorimaea: aCell bufferPhthorimaea + (dispersal / self neighbourhood size)].
"----------------------------------------------------------------------------------------------------------------------------------------------------------"
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveS-(K-200)) )exp) ))* (1-qualityHabitat).
numMigre := ye * self moveS.
distance := (Cormas randomFrom: 250 to: 499).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal500 := yd * yeReal.
distance := (Cormas randomFrom: 200 to: 249).
yd := ((0 - a) * distance) exp.
yeReal :=1.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - a) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
dispersal := (yeReal500 +yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
self bufferSymmetrischemma: self bufferSymmetrischemma - dispersal.
self neighbourhood do: [:aCell | aCell bufferSymmetrischemma: aCell bufferSymmetrischemma + (dispersal / self neighbourhood size)].
movePTM_NORMAL_200
"US = rules for the dispersion of the moth by diffusion used for testing other dispersal capabilities"
| yd distance ye numMigre longCell yeReal surface dispersal yeReal200 yeReal150 yeReal100 yeReal75 yeReal50 yeReal25 yeReal10 yeReal5 yeReal1 K|
K :=1000.
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveT-(K-200)) )exp) ))* (1-qualityHabitat).
numMigre := ye * self moveT.
longCell := 500.
surface := longCell * longCell.
distance := 200.
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
dispersal := (yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
self bufferTecia: self bufferTecia - dispersal.
self neighbourhood do: [:aCell | aCell bufferTecia: aCell bufferTecia + (dispersal / self neighbourhood size)].
"----------------------------------------------------------------------------------------------------------------------------------------------------------"
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveP-(K-200)) )exp) ))* (1-qualityHabitat).
numMigre := ye * self moveP.
distance := 200.
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
dispersal := (yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
self bufferPhthorimaea: self bufferPhthorimaea - dispersal.
self neighbourhood do: [:aCell | aCell bufferPhthorimaea: aCell bufferPhthorimaea + (dispersal / self neighbourhood size)].
"----------------------------------------------------------------------------------------------------------------------------------------------------------"
ye := (0.4/(1 + 0.1 * (( (0- 0.005) * (self moveS-(K-200)) )exp) ))* (1-qualityHabitat).
numMigre := ye * self moveS.
distance := 200.
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal200 := yd * yeReal.
distance := (Cormas randomFrom: 150 to: 199).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal150 := yd * yeReal.
distance := (Cormas randomFrom: 100 to: 149).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal100 := yd * yeReal.
distance := (Cormas randomFrom: 75 to: 99).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal75 := yd * yeReal.
distance := (Cormas randomFrom: 50 to: 74).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal50 := yd * yeReal.
distance := (Cormas randomFrom: 25 to: 49).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal25 := yd * yeReal.
distance := (Cormas randomFrom: 10 to: 24).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal10 := yd * yeReal.
distance := (Cormas randomFrom: 5 to: 9).
yd := ((0 - 0.015) * distance) exp.
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal5 := yd * yeReal.
distance := 1.
yd := 1. "we assume that each PTM is moving in a 1 m² square"
yeReal := (surface - ((longCell - (distance * 2))**2))/surface.
yeReal1 := yd * yeReal.
dispersal := (yeReal200 + yeReal150 + yeReal100 + yeReal75 + yeReal50 + yeReal25 + yeReal10 + yeReal5 + yeReal1) * numMigre.
self bufferSymmetrischemma: self bufferSymmetrischemma - dispersal.
self neighbourhood do: [:aCell | aCell bufferSymmetrischemma: aCell bufferSymmetrischemma + (dispersal / self neighbourhood size)].
reproduceFemales
"US = reproduction rules for the moths"
"ES = Regla de reproducción de las hembras"
| sexRatio matingRateT matingRateP matingRateS corT corP corS|
sexRatio := 0.5.
matingRateT := 1.
matingRateP := 1.
matingRateS := 1.
self teciaFemale: self teciaAdults * sexRatio * matingRateT.
self phthorimaeaFemale: self phthorimaeaAdults * sexRatio * matingRateP.
self symmetrischemaFemale: self symmetrischemaAdults * sexRatio * matingRateS.
"corección debido a que todas las polillas no tienen el mismo tiempo de desarollo"
corT := 0.
corP := (rateLifePhthorimaea - rateLifeTecia) / rateLifeTecia.
corS := (rateLifeSymmetrischemma - rateLifeTecia) / rateLifeTecia.
"fitness correction * fecundity/(max(fecundity))"
self rT: self fecundityTecia.
self rP: self fecundityPhthorimaea + ( self fecundityPhthorimaea * corP).
self rS: self fecunditySymmetrischemma + ( self fecunditySymmetrischemma * corS).
"for probes and pov"
self bufferNumberTeciaFemale: self teciaFemale.
self bufferNumberPhthorimaeaFemale: self phthorimaeaFemale.
self bufferNumberSymmetrischemaFemale: self symmetrischemaFemale.
"REPRODUCTION"
self tecia: self teciaFemale * self rT.
self phthorimaea: self phthorimaeaFemale * self rP.
self symmetrischemma: self symmetrischemaFemale * self rS.
"correciones de fecundidad para que los numeros no sean demasiado grandes en relación con el K de nuestro modelo"
self tecia < 0 ifTrue: [self tecia: 0].
self phthorimaea < 0 ifTrue: [self phthorimaea: 0].
self symmetrischemma < 0 ifTrue: [self symmetrischemma: 0].
self tecia > 100000 ifTrue: [self tecia: 100000].
self phthorimaea > 100000 ifTrue: [self phthorimaea: 100000].
self symmetrischemma > 100000 ifTrue: [self symmetrischemma: 100000].
updateFecundityFemale
"US = rules to update offsrping"
"eq := a+b*EXP(-((( tempPromedio -c)/d)+((e-1)/e)^(1/e))^e+((e-1)/e))*((e-1)/e)^(-((e-1)/e))*((( tempPromedio -c)/d)+((e-1)/e)^(1/e))^(e-1)"
"TECIA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
|a b c d e f eq1 eq2 eq3 eq4 x|
a := 0 - 30.11838694327944.
b := 343.2811048339828.
c := 18.75284501202404.
d := 17.10856111462315.
e := 3.299843838878276.
x := tempStochastic.
eq1 := x - c.
eq1 := eq1 / d.
eq2 := e - 1.
eq2 := eq2 / e.
eq2 := eq2 ** (1 / e).
eq1 := eq1 + eq2.
eq1 := eq1 ** e.
eq1 := 0 - eq1.
eq2 := e - 1.
eq2 := eq2 / e.
eq1 := eq1 + eq2.
eq1 := eq1 exp.
eq1 := b * eq1.
eq2 := x - c.
eq2 := eq2 / d.
eq3 := e - 1.
eq3 := eq3 / e.
eq3 := eq3 ** (1/e).
eq2 := eq2 + eq3.
eq2 := eq2 ** (e-1).
eq3 := e - 1.
eq3 := eq3 / e.
eq4 := e - 1.
eq4 := eq4 / e.
eq4 := 0 - eq4.
eq3 := eq3 ** eq4.
eq1 := eq1 * eq3 * eq2.
eq1 := a + eq1.
eq1 < 0 ifTrue:[ eq1 := 0].
self fecundityTecia: eq1.
"PHTHORIMAEA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
a := 0 - 3468.925524381997.
b := 3606.259209047108.
c := 21.07236736926119.
d := 220.9979571820878.
e := 4.705734323803844.
x := tempStochastic.
eq1 := x - c.
eq1 := eq1 / d.
eq2 := e - 1.
eq2 := eq2 / e.
eq2 := eq2 ** (1 / e).
eq1 := eq1 + eq2.
eq1 := eq1 ** e.
eq1 := 0 - eq1.
eq2 := e - 1.
eq2 := eq2 / e.
eq1 := eq1 + eq2.
eq1 := eq1 exp.
eq1 := b * eq1.
eq2 := x - c.
eq2 := eq2 / d.
eq3 := e - 1.
eq3 := eq3 / e.
eq3 := eq3 ** (1/e).
eq2 := eq2 + eq3.
eq2 := eq2 ** (e-1).
eq3 := e - 1.
eq3 := eq3 / e.
eq4 := e - 1.
eq4 := eq4 / e.
eq4 := 0 - eq4.
eq3 := eq3 ** eq4.
eq1 := eq1 * eq3 * eq2.
eq1 := a + eq1.
eq1 < 0 ifTrue:[ eq1 := 0].
self fecundityPhthorimaea: eq1.
"SYMMETRISCHEMA---------------------------------------------------------------------------------------------------------------------------------------------------------------------"
a := 0 - 2.061525357320953e-12.
b := 218.4559081941613.
c := 15.10830693327336.
d := 19.48393797288984.
e := 2.571556160851190.
f := 4.309180129635479.
x := tempStochastic.
eq1 := x - c.
eq1 := eq1 / d.
eq2 := e - 1.
eq2 := eq2 / e.
eq2 := eq2 ** (1 / e).
eq1 := eq1 + eq2.
eq1 := eq1 ** e.
eq1 := 0 - eq1.
eq2 := e - 1.
eq2 := eq2 / e.
eq1 := eq1 + eq2.
eq1 := eq1 exp.
eq1 := b * eq1.
eq2 := x - c.
eq2 := eq2 / d.
eq3 := e - 1.
eq3 := eq3 / e.
eq3 := eq3 ** (1/e).
eq2 := eq2 + eq3.
eq2 := eq2 ** (e-1).
eq3 := e - 1.
eq3 := eq3 / e.
eq4 := e - 1.
eq4 := eq4 / e.
eq4 := 0 - eq4.
eq3 := eq3 ** eq4.
eq1 := eq1 * eq3 * eq2.
eq1 := a + eq1.
eq1 < 0 ifTrue:[ eq1 := 0].
self fecunditySymmetrischemma: eq1.
updateHOMOGENEQualityHabitat
"US = resources availabiblity"
"ES = Regla para determinar según el uso de la zona, la cuantidad de recurso disponible"
self qualityHabitat: (Cormas randomFrom: 0.1 to: 0.9).
updateHOMOGENETempStochastic
"US = stochasticity over temperature"
"ES = Regla para modificar la temperatura promedia según la capa de estochasticidad"
self tempStochastic: 20.
updatePTMdispersion
"US = neighborhood of a given location"
"ES = Regla para poner las polillas alrejedor de una celda considerada"
self teciaAdults: self teciaAdults + self bufferTecia.
self bufferTecia: 0.
self phthorimaeaAdults: self phthorimaeaAdults + self bufferPhthorimaea.
self bufferPhthorimaea: 0.
self symmetrischemaAdults: self symmetrischemaAdults + self bufferSymmetrischemma.
self bufferSymmetrischemma: 0.
updateQualityHabitat
"US = quality habitat"
"ES = Regla para determinar según el uso de la zona, la cuantidad de recurso disponible"
self qualityHabitat: (Cormas randomFrom: 0.3 to: 0.9).
self agro = 0 ifTrue:[self qualityHabitat: (Cormas randomFrom: 0 to: 0.3)].
self bodega = 1 ifTrue:[self qualityHabitat: (Cormas randomFrom: 0.9 to: 1)].
updateRateLife
"US = correction over fitness to take into account the fact that the different moth species does not have the same developmental time as a function of temperature"
"ES = Regla para conocer el tiempo de desarollo de cada polilla"
| rateLifeEgg rateLifeLarva rateLifePupa devRateEgg devRateLarva devRatePupa tDemiLEgg tDemiLLarva tDemiLPupa deltaHAEgg deltaHALarva deltaHAPupa deltaHLEgg deltaHLLarva deltaHLPupa deltaHHEgg deltaHHLarva deltaHHPupa tDemiHEgg tDemiHLarva tDemiHPupa tempKelvinPromedio R|
"TECIA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
devRateEgg := 0.179.
devRateLarva := 0.076.
devRatePupa := 0.187.
deltaHAEgg := 17250.
deltaHALarva := 11000.
deltaHAPupa :=11500.
deltaHLEgg := 0 - 48000.
deltaHLLarva := 0 - 50000.
deltaHLPupa := 0 -35000.
tDemiLEgg := 265.2.
tDemiLLarva := 283.1.
tDemiLPupa := 290.0.
deltaHHEgg := 121830.
deltaHHLarva := 275000.
deltaHHPupa := 125000.
tDemiHEgg := 304.2.
tDemiHLarva := 302.1.
tDemiHPupa := 299.5.
"----------------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"----------------------------------------------------------------------------------"
R := 1.987. "universal gas constant"
rateLifeEgg := (1/298.16) - (1/tempKelvinPromedio).
rateLifeEgg := (deltaHAEgg * rateLifeEgg).
rateLifeEgg := (rateLifeEgg) exp.
rateLifeEgg := ((devRateEgg * tempKelvinPromedio) /298.16) *rateLifeEgg.
rateLifeEgg := rateLifeEgg / (((((((1/tDemiLEgg) - (1/tempKelvinPromedio)) * deltaHLEgg) / R) exp) + 1) + (((((1/tDemiHEgg) - (1/tempKelvinPromedio)) * deltaHHEgg) / R) exp)).
rateLifeLarva := (1/298.16) - (1/tempKelvinPromedio).
rateLifeLarva := (deltaHALarva * rateLifeLarva).
rateLifeLarva := (rateLifeLarva) exp.
rateLifeLarva := ((devRateLarva * tempKelvinPromedio) /298.16) *rateLifeLarva.
rateLifeLarva := rateLifeLarva / (((((((1/tDemiLLarva) - (1/tempKelvinPromedio)) * deltaHLLarva) / R) exp) + 1) + (((((1/tDemiHLarva) - (1/tempKelvinPromedio)) * deltaHHLarva) / R) exp)).
rateLifePupa := (1/298.16) - (1/tempKelvinPromedio).
rateLifePupa := (deltaHAPupa * rateLifePupa).
rateLifePupa := (rateLifePupa) exp.
rateLifePupa := ((devRatePupa * tempKelvinPromedio) /298.16) *rateLifePupa.
rateLifePupa := rateLifePupa / (((((((1/tDemiLPupa) - (1/tempKelvinPromedio)) * deltaHLPupa) / R) exp) + 1) + (((((1/tDemiHPupa) - (1/tempKelvinPromedio)) * deltaHHPupa) / R) exp)).
self rateLifeTecia: ((21*rateLifeEgg) + (47*rateLifeLarva) + (32*rateLifePupa))/100.
self rateLifeTecia <=0 ifTrue:[self rateLifeTecia: 0].
"PHTHORIMAEA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
devRateEgg := 0.190.
devRateLarva := 0.070.
devRatePupa := 0.119.
deltaHAEgg := 17250.
deltaHALarva := 11000.
deltaHAPupa :=11500.
deltaHLEgg := 0 - 48000.
deltaHLLarva := 0 - 50000.
deltaHLPupa := 0 -35000.
tDemiLEgg := 278.1.
tDemiLLarva := 287.5.
tDemiLPupa := 285.5.
deltaHHEgg := 121830.
deltaHHLarva := 275000.
deltaHHPupa := 125000.
tDemiHEgg := 309.4.
tDemiHLarva := 309.2.
tDemiHPupa := 312.3.
"----------------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"----------------------------------------------------------------------------------"
R := 1.987. "universal gaz constant"
rateLifeEgg := (1/298.16) - (1/tempKelvinPromedio).
rateLifeEgg := (deltaHAEgg * rateLifeEgg).
rateLifeEgg := (rateLifeEgg) exp.
rateLifeEgg := ((devRateEgg * tempKelvinPromedio) /298.16) *rateLifeEgg.
rateLifeEgg := rateLifeEgg / (((((((1/tDemiLEgg) - (1/tempKelvinPromedio)) * deltaHLEgg) / R) exp) + 1) + (((((1/tDemiHEgg) - (1/tempKelvinPromedio)) * deltaHHEgg) / R) exp)).
rateLifeLarva := (1/298.16) - (1/tempKelvinPromedio).
rateLifeLarva := (deltaHALarva * rateLifeLarva).
rateLifeLarva := (rateLifeLarva) exp.
rateLifeLarva := ((devRateLarva * tempKelvinPromedio) /298.16) *rateLifeLarva.
rateLifeLarva := rateLifeLarva / (((((((1/tDemiLLarva) - (1/tempKelvinPromedio)) * deltaHLLarva) / R) exp) + 1) + (((((1/tDemiHLarva) - (1/tempKelvinPromedio)) * deltaHHLarva) / R) exp)).
rateLifePupa := (1/298.16) - (1/tempKelvinPromedio).
rateLifePupa := (deltaHAPupa * rateLifePupa).
rateLifePupa := (rateLifePupa) exp.
rateLifePupa := ((devRatePupa * tempKelvinPromedio) /298.16) *rateLifePupa.
rateLifePupa := rateLifePupa / (((((((1/tDemiLPupa) - (1/tempKelvinPromedio)) * deltaHLPupa) / R) exp) + 1) + (((((1/tDemiHPupa) - (1/tempKelvinPromedio)) * deltaHHPupa) / R) exp)).
self rateLifePhthorimaea: ((16*rateLifeEgg) + (56*rateLifeLarva) + (29*rateLifePupa))/100.
self rateLifePhthorimaea <=0 ifTrue:[self rateLifePhthorimaea: 0].
"SYMMETRISCHEMA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
devRateEgg := 0.185.
devRateLarva := 0.050.
devRatePupa := 0.094.
deltaHAEgg := 17250.
deltaHALarva := 11000.
deltaHAPupa :=11500.
deltaHLEgg := 0 - 48000.
deltaHLLarva := 0 - 50000.
deltaHLPupa := 0 -35000.
tDemiLEgg := 280.0.
tDemiLLarva := 282.1.
tDemiLPupa := 283.2.
deltaHHEgg := 121830.
deltaHHLarva := 275000.
deltaHHPupa := 125000.
tDemiHEgg := 303.5.
tDemiHLarva := 305.1.
tDemiHPupa := 302.2.
"----------------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"----------------------------------------------------------------------------------"
R := 1.987.
rateLifeEgg := (1/298.16) - (1/tempKelvinPromedio).
rateLifeEgg := (deltaHAEgg * rateLifeEgg).
rateLifeEgg := (rateLifeEgg) exp.
rateLifeEgg := ((devRateEgg * tempKelvinPromedio) /298.16) *rateLifeEgg.
rateLifeEgg := rateLifeEgg / (((((((1/tDemiLEgg) - (1/tempKelvinPromedio)) * deltaHLEgg) / R) exp) + 1) + (((((1/tDemiHEgg) - (1/tempKelvinPromedio)) * deltaHHEgg) / R) exp)).
rateLifeLarva := (1/298.16) - (1/tempKelvinPromedio).
rateLifeLarva := (deltaHALarva * rateLifeLarva).
rateLifeLarva := (rateLifeLarva) exp.
rateLifeLarva := ((devRateLarva * tempKelvinPromedio) /298.16) *rateLifeLarva.
rateLifeLarva := rateLifeLarva / (((((((1/tDemiLLarva) - (1/tempKelvinPromedio)) * deltaHLLarva) / R) exp) + 1) + (((((1/tDemiHLarva) - (1/tempKelvinPromedio)) * deltaHHLarva) / R) exp)).
rateLifePupa := (1/298.16) - (1/tempKelvinPromedio).
rateLifePupa := (deltaHAPupa * rateLifePupa).
rateLifePupa := (rateLifePupa) exp.
rateLifePupa := ((devRatePupa * tempKelvinPromedio) /298.16) *rateLifePupa.
rateLifePupa := rateLifePupa / (((((((1/tDemiLPupa) - (1/tempKelvinPromedio)) * deltaHLPupa) / R) exp) + 1) + (((((1/tDemiHPupa) - (1/tempKelvinPromedio)) * deltaHHPupa) / R) exp)).
self rateLifeSymmetrischemma: ((17*rateLifeEgg) + (51*rateLifeLarva) + (32*rateLifePupa))/100.
self rateLifeSymmetrischemma <=0 ifTrue:[self rateLifeSymmetrischemma: 0].
updateSurvivalRate
"US = rules for the moth survival"
"ES = Regla para conocer la supervivencia de cada polilla según la temperatura"
| tempKelvinPromedio R aEgg bEgg cEgg dEgg eEgg fEgg aPupa bPupa cPupa dPupa ePupa fPupa aLarva bLarva cLarva dLarva eLarva fLarva survivalRateEggTecia survivalRateEggPhthorimaea survivalRateEggSymmetrischemma survivalRateLarvaTecia survivalRateLarvaPhthorimaea survivalRateLarvaSymmetrischemma survivalRatePupaTecia survivalRatePupaPhthorimaea survivalRatePupaSymmetrischemma|
R := 1.987. "universal gas constant"
"TECIA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
aEgg := 0.822.
bEgg := 0 - 758.5.
cEgg := 0 - 212100.
dEgg := 281.9.
eEgg := 405200.
fEgg := 303.8.
aLarva := 0.758.
bLarva := 0 - 180.2.
cLarva := 0 - 475700.
dLarva := 282.7.
eLarva := 1298000.
fLarva := 301.5.
aPupa := 0.9.
bPupa := 0 - 73.72.
cPupa := 0 - 1263000.
dPupa := 286.5.
ePupa := 1095000.
fPupa := 306.3.
"------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"------------------------------------------------------------------------"
survivalRateEggTecia := (1/298.16) - (1/tempKelvinPromedio).
survivalRateEggTecia := (bEgg * survivalRateEggTecia).
survivalRateEggTecia := (survivalRateEggTecia) exp.
survivalRateEggTecia := ((aEgg * tempKelvinPromedio) /298.16) *survivalRateEggTecia.
survivalRateEggTecia := survivalRateEggTecia / (((((((1/dEgg) - (1/tempKelvinPromedio)) * cEgg) / R) exp) + 1) + (((((1/fEgg) - (1/tempKelvinPromedio)) * eEgg) / R) exp)).
survivalRateEggTecia <=0 ifTrue:[survivalRateEggTecia:=0].
survivalRateLarvaTecia := (1/298.16) - (1/tempKelvinPromedio).
survivalRateLarvaTecia := (bLarva * survivalRateLarvaTecia).
survivalRateLarvaTecia := (survivalRateLarvaTecia) exp.
survivalRateLarvaTecia := ((aLarva * tempKelvinPromedio) /298.16) *survivalRateLarvaTecia.
survivalRateLarvaTecia := survivalRateLarvaTecia / (((((((1/dLarva) - (1/tempKelvinPromedio)) * cLarva) / R) exp) + 1) + (((((1/fLarva) - (1/tempKelvinPromedio)) * eLarva) / R) exp)).
survivalRateLarvaTecia <=0 ifTrue:[survivalRateLarvaTecia:=0].
survivalRatePupaTecia := (1/298.16) - (1/tempKelvinPromedio).
survivalRatePupaTecia := (bPupa * survivalRatePupaTecia).
survivalRatePupaTecia := (survivalRatePupaTecia) exp.
survivalRatePupaTecia := ((aPupa * tempKelvinPromedio) /298.16) *survivalRatePupaTecia.
survivalRatePupaTecia := survivalRatePupaTecia / (((((((1/dPupa) - (1/tempKelvinPromedio)) * cPupa) / R) exp) + 1) + (((((1/fPupa) - (1/tempKelvinPromedio)) * ePupa) / R) exp)).
survivalRatePupaTecia <=0 ifTrue:[survivalRatePupaTecia:=0].
self survivalRateTecia: survivalRatePupaTecia * survivalRateLarvaTecia * survivalRateEggTecia.
self survivalRateTecia <0 ifTrue:[self survivalRateTecia: 0].
"PHTHORIMAEA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
aEgg := 0.917.
bEgg := 50.
cEgg := 0 - 200000.
dEgg := 283.3.
eEgg := 400000.
fEgg := 310.1.
aLarva := 0.950.
bLarva := 0 - 150.
cLarva := 0 - 400000.
dLarva := 284.4.
eLarva := 900000.
fLarva := 310.
aPupa := 0.96.
bPupa := 50.
cPupa := 0 - 800000.
dPupa := 283.1.
ePupa := 700000.
fPupa := 312.2.
"----------------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"----------------------------------------------------------------------------------"
survivalRateEggPhthorimaea := (1/298.16) - (1/tempKelvinPromedio).
survivalRateEggPhthorimaea := (bEgg * survivalRateEggPhthorimaea).
survivalRateEggPhthorimaea := (survivalRateEggPhthorimaea) exp.
survivalRateEggPhthorimaea := ((aEgg * tempKelvinPromedio) /298.16) *survivalRateEggPhthorimaea.
survivalRateEggPhthorimaea := survivalRateEggPhthorimaea / (((((((1/dEgg) - (1/tempKelvinPromedio)) * cEgg) / R) exp) + 1) + (((((1/fEgg) - (1/tempKelvinPromedio)) * eEgg) / R) exp)).
survivalRateEggPhthorimaea <=0 ifTrue:[survivalRateEggPhthorimaea:=0].
survivalRateLarvaPhthorimaea := (1/298.16) - (1/tempKelvinPromedio).
survivalRateLarvaPhthorimaea := (bLarva * survivalRateLarvaPhthorimaea).
survivalRateLarvaPhthorimaea := (survivalRateLarvaPhthorimaea) exp.
survivalRateLarvaPhthorimaea := ((aLarva * tempKelvinPromedio) /298.16) *survivalRateLarvaPhthorimaea.
survivalRateLarvaPhthorimaea := survivalRateLarvaPhthorimaea / (((((((1/dLarva) - (1/tempKelvinPromedio)) * cLarva) / R) exp) + 1) + (((((1/fLarva) - (1/tempKelvinPromedio)) * eLarva) / R) exp)).
survivalRateLarvaPhthorimaea <=0 ifTrue:[survivalRateLarvaPhthorimaea:=0].
survivalRatePupaPhthorimaea := (1/298.16) - (1/tempKelvinPromedio).
survivalRatePupaPhthorimaea := (bPupa * survivalRatePupaPhthorimaea).
survivalRatePupaPhthorimaea := (survivalRatePupaPhthorimaea) exp.
survivalRatePupaPhthorimaea := ((aPupa * tempKelvinPromedio) /298.16) *survivalRatePupaPhthorimaea.
survivalRatePupaPhthorimaea := survivalRatePupaPhthorimaea / (((((((1/dPupa) - (1/tempKelvinPromedio)) * cPupa) / R) exp) + 1) + (((((1/fPupa) - (1/tempKelvinPromedio)) * ePupa) / R) exp)).
survivalRatePupaPhthorimaea <=0 ifTrue:[survivalRatePupaPhthorimaea:=0].
self survivalRatePhthorimaea: survivalRatePupaPhthorimaea*survivalRateLarvaPhthorimaea*survivalRateEggPhthorimaea.
self survivalRatePhthorimaea <0 ifTrue:[self survivalRatePhthorimaea: 0].
"SYMMETRISCHEMA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
R := 1.987. "universal gas constant"
aEgg := 0.834.
bEgg := 10.94.
cEgg := 0 - 234000.
dEgg := 282.4.
eEgg := 616600.
fEgg := 304.1.
aLarva := 0.694.
bLarva := 0 - 236.3.
cLarva := 0 - 420300.
dLarva := 283.1.
eLarva := 1551000.
fLarva := 305.6.
aPupa := 0.882.
bPupa := 39.93.
cPupa := 0 - 992700.
dPupa := 282.9.
ePupa := 1110000.
fPupa := 304.7.
"----------------------------------------------------------------------------------"
tempKelvinPromedio := tempStochastic + 273.5.
"----------------------------------------------------------------------------------"
survivalRateEggSymmetrischemma := 1 / 298.16 - (1 / tempKelvinPromedio).
survivalRateEggSymmetrischemma := bEgg * survivalRateEggSymmetrischemma.
survivalRateEggSymmetrischemma := survivalRateEggSymmetrischemma exp.
survivalRateEggSymmetrischemma := aEgg * tempKelvinPromedio / 298.16
* survivalRateEggSymmetrischemma.
survivalRateEggSymmetrischemma := survivalRateEggSymmetrischemma
/ (((1 / dEgg - (1 / tempKelvinPromedio)) * cEgg / R) exp + 1
+ ((1 / fEgg - (1 / tempKelvinPromedio)) * eEgg / R) exp).
survivalRateEggSymmetrischemma <=0 ifTrue:[survivalRateEggSymmetrischemma:=0].
survivalRateLarvaSymmetrischemma := 1 / 298.16 - (1 / tempKelvinPromedio).
survivalRateLarvaSymmetrischemma := bLarva
* survivalRateLarvaSymmetrischemma.
survivalRateLarvaSymmetrischemma := survivalRateLarvaSymmetrischemma exp.
survivalRateLarvaSymmetrischemma := aLarva * tempKelvinPromedio / 298.16
* survivalRateLarvaSymmetrischemma.
survivalRateLarvaSymmetrischemma := survivalRateLarvaSymmetrischemma
/ (((1 / dLarva - (1 / tempKelvinPromedio)) * cLarva / R) exp + 1
+ ((1 / fLarva - (1 / tempKelvinPromedio)) * eLarva / R) exp).
survivalRateLarvaSymmetrischemma <=0 ifTrue:[survivalRateLarvaSymmetrischemma:=0].
survivalRatePupaSymmetrischemma := 1 / 298.16 - (1 / tempKelvinPromedio).
survivalRatePupaSymmetrischemma := bPupa * survivalRatePupaSymmetrischemma.
survivalRatePupaSymmetrischemma := survivalRatePupaSymmetrischemma exp.
survivalRatePupaSymmetrischemma := aPupa * tempKelvinPromedio / 298.16
* survivalRatePupaSymmetrischemma.
survivalRatePupaSymmetrischemma := survivalRatePupaSymmetrischemma
/ (((1 / dPupa - (1 / tempKelvinPromedio)) * cPupa / R) exp + 1
+ ((1 / fPupa - (1 / tempKelvinPromedio)) * ePupa / R) exp).
survivalRatePupaSymmetrischemma <=0 ifTrue:[survivalRatePupaSymmetrischemma:=0].
self survivalRateSymmetrischemma: survivalRatePupaSymmetrischemma*survivalRateLarvaSymmetrischemma*survivalRateEggSymmetrischemma.
self survivalRateSymmetrischemma <0 ifTrue:[self survivalRateSymmetrischemma: 0].
updateTempStochastic
"US = to put stochasticity into temperature so that it takes into account uncertainties"
"ES = Regla para modificar la temperatura promedia según la capa de estochasticidad"
|ratioP|
ratioP := (self tempPromedio*0.653)/8.
self tempStochastic: self tempPromedio + (ratioP* self stochastic).
MsgHelp
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.Msg
false
none
location nivel ag
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.MsgHelp accessing
ag
^ag
ag: anObject
ag := anObject
location
^location
location: anObject
location := anObject
nivel
^nivel
nivel: anObject
nivel := anObject
Ag_Isolate_04
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_04 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_04 control
Ag_Isolate_04_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_04_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_04_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_04_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_04_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_04_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_04 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_04 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 4.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag <7 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 4.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_04 pov
pov
^#Ag_Isolate_04
Ag_Isolate_14
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_14 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_14 control
Ag_Isolate_014_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_14_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_14_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_14_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_14_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_14_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_14 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil: [numActions := 5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_14 pov
pov
^#Ag_Isolate_14
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_14 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 14.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 14.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_05
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_05 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_05 control
Ag_Isolate_05_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_05_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_05_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_05_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_05_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_05_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_05 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_05 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 5.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag <7 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 5.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_05 pov
pov
^#Ag_Isolate_05
Ag_Isolate_15
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_15 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_15 control
Ag_Isolate_015_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_15_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_15_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_15_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_15_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_15_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_15 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=5]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_15 pov
pov
^#Ag_Isolate_15
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_15 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 15.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage := self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 15.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
MsgPhthorimaea
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.Msg
false
none
location
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.MsgPhthorimaea accessing
location
^location
location: anObject
location := anObject
Ag_Isolate_10
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_10 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_10 control
Ag_Isolate_010_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_10_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_10_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_10_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_10_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_10_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_10 pov
pov
^#Ag_Isolate_10
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_10 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_10 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 10.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 10.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_06
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_06 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_06 control
Ag_Isolate_06_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_06_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_06_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_06_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_06_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_06_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_06 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_06 pov
pov
^#Ag_Isolate_06
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_06 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 6.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre |
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag <7 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 6.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_11
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_11 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_11 control
Ag_Isolate_011_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_11_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_11_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_11_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_11_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_11_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_11 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=2]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_11 pov
pov
^#Ag_Isolate_11
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_11 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 11.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 11.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_01
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 control
Ag_Isolate_01_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_01_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_01_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_01_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_01_withCom
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
"Para comunicar"
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_01_withoutCom
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 1.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"US = to constrain agents' movements into their field and communities"
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
msgPutAnEnd
self mailBox removeAll: (self mailBox select:[:k | k symbol = #pleaseHelp]).
self mailBox removeAll: (self mailBox select:[:k | k symbol = #ok]).
mailBox:=OrderedCollection new.
readMailAlarmCalling
|m2 nbrMails nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag < 7 ifTrue:[busy = 1 ifFalse:[
nbrMails:= (m1 symbol = #pleaseHelp) size.
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 1.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=0]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 pov
pov
^#Ag_Isolate_01.
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_01 archive
readMail
| aMessage |
aMessage:= self nextMessage.
aMessage notNil ifTrue:[
aMessage object < self nivelFormation ifTrue:[
" reply:= "
self numActions: 1]].
Ag_Isolate_09
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_09 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_09 control
Ag_Isolate_09_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_09_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_09_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_09_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_09_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_09_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_09 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=5]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_09 pov
pov
^#Ag_Isolate_09
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_09 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 9.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 9.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Agri04
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation areaTotal riego maquinaria semillaPapa rotationVariedad aproFerti almacen
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Agri04
Agri04 representa a los agentes papicultores que tienen un nivel de capacitación o de conocimiento de 4.
Instance Variables:
almacen <SmallInteger> description of almacen
aproFerti <SmallInteger> si=1 y no=0
areaTotal <SmallInteger> description of areaTotal
maquinaria <SmallInteger> si=1 y no=0
nivelFormation <SmallInteger> nivel = 4
riego <SmallInteger> description of riego
rotationVariedad <SmallInteger> description of rotationVariedad
semillaPapa <SmallInteger> description of semillaPapa
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 control
step
"to be completed"
step004
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step04
self alarmCalling.
self readMail.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step04_Part
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 pov
pov
^#Agri04.
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 rules
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2.
seuil:=100/self nivelFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch bufferNumberPhthorimaeaFemale>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*(1-eficacidadTratamientoChimico)].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*(1-eficacidadTratamientoChimico)].
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 accessing
almacen
"Getter accessor with default value = 1 "
^almacen ifNil:[almacen := 1]
almacen: anObject
almacen := anObject
aproFerti
"Getter accessor with default value = 1 "
^aproFerti ifNil:[aproFerti := 1]
aproFerti: anObject
aproFerti := anObject
areaTotal
"Getter accessor with default value = 1 "
^areaTotal ifNil:[areaTotal := 1]
areaTotal: anObject
areaTotal := anObject
maquinaria
"Getter accessor with default value = 1 "
^maquinaria ifNil:[maquinaria := 1]
maquinaria: anObject
maquinaria := anObject
nivelFormation
"Getter accessor with default value = 4 "
^nivelFormation ifNil:[nivelFormation := 4]
nivelFormation: anObject
nivelFormation := anObject
riego
"Getter accessor with default value = 1 "
^riego ifNil:[riego := 1]
riego: anObject
riego := anObject
rotationVariedad
"Getter accessor with default value = 1 "
^rotationVariedad ifNil:[rotationVariedad := 1]
rotationVariedad: anObject
rotationVariedad := anObject
semillaPapa
"Getter accessor with default value = 1 "
^semillaPapa ifNil:[semillaPapa := 1]
semillaPapa: anObject
semillaPapa := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Agri04 msg
alarmCalling
"para enviar un mensage a los demas si la polilla mas abundante acerca de un agente es mas alta que una valor dependiente del nivel de percepción de un agente"
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas agriOnMyCell|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
"el mensage es enviado si hay mas de numCeldas celdas alrejedor de un agente"
agriOnMyCell := IndexedSet new.
1 to: 5 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Agri0', i printString) asSymbol) withinRange: 5)].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
agriOnMyCell do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm]].
alarmCallingAggregate
| alarmT alarmP alarmS alarm teciaedCell phthedCell symedCell PTMCell aggregateT aggregateP aggregateS aggregate numCellPTM tot|
numCellPTM:=10.
tot:=150.
teciaedCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
phthedCell := self patch neighbourhood detect: [:f | f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
symedCell := self patch neighbourhood detect: [:f | f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
PTMCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))]]] ifNone: [^nil].
aggregateT := teciaedCell theCSE at: #AggregateTecia.
aggregateP := phthedCell theCSE at: #AggregatePhthorimaea.
aggregateS := symedCell theCSE at: #AggregateSymmetrischema.
aggregate := PTMCell theCSE at: #Aggregate.
aggregate size > numCellPTM
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: aggregate components).
alarm receiver: x.
self sendMessageAsynchronously: alarm]].
readMail
| aMessage |
aMessage := self nextMessage.
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]
Ag_Isolate_16
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_16 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_16 control
Ag_Isolate_016_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_16_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_16_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_16_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_16_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_16_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_16 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_16 pov
pov
^#Ag_Isolate_16
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_16 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 16.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage := self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 16.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
Ag_Isolate_02
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions nbrMailsRcp nbrMailsTrt top penality forAchange mailSent mailSentRsp probaDe3
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_02 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_02 control
Ag_Isolate_02_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_02_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_02_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_02_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_02_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_02_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_02 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
mailSent
^mailSent ifNil: [mailSent := 0]
mailSent: anObject
mailSent := anObject
mailSentRsp
^mailSentRsp ifNil: [mailSentRsp := 0]
mailSentRsp: anObject
mailSentRsp := anObject
nbrMailsRcp
^nbrMailsRcp ifNil: [nbrMailsRcp := 0]
nbrMailsRcp: anObject
nbrMailsRcp := anObject
nbrMailsTrt
^nbrMailsTrt ifNil: [nbrMailsTrt := 0]
nbrMailsTrt: anObject
nbrMailsTrt := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=1]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
probaDe3
^probaDe3 ifNil:[probaDe3:=0.75]
probaDe3: anObject
probaDe3 := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_02 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]. NE MARCHE PAS... RAISON INCONNUE..."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
self mailSent: (self mailSent+1).
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 2.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self mailSentRsp: (self mailSentRsp+1).
proba>self probaDe3
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>(1-self probaDe3)
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag <7 ifTrue:[
busy = 1 ifFalse:[
self nbrMailsRcp: (self nbrMailsRcp+1).
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
self nbrMailsTrt: (self nbrMailsTrt+1).
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 2.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_02 pov
pov
^#Ag_Isolate_02
Ag_Isolate_03
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_03 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_03 control
Ag_Isolate_03_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_03_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_03_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_03_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_03_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_03_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_03 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=5]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_03 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc dist|
dist:=5.
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"1 to: 6 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_01 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_02 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_03 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_04 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_05 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_06 withinRange: dist).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 3.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 7 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 nivelAutre busy|
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag <7 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 3.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil multip seuilVariable|
multip:=0.2.
seuilVariable:=100.
eficacidadTratamientoChimico:= self nivelFormation*multip*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=seuilVariable/self nivelFormation.] ifTrue:[seuil:=seuilVariable].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch tecia<0 ifTrue:[self patch tecia:0].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_03 pov
pov
^#Ag_Isolate_03
Ag_Isolate_07
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_07 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_07 control
Ag_Isolate_07_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_07_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_07_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_07_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_07_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_07_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_07 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=0]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_07 pov
pov
^#Ag_Isolate_07
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_07 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"7 to: 9 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_0', i printString) asSymbol) withinRange: 5)].
10 to: 12 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_07 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_08 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_09 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_10 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_11 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_12 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 7.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel]]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag < 13 and:[m2 ag > 6 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ]].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre |
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >6 and:[m1 ag<13 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 7.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
"self mailBox removeAll:(self mailBox select:[:m |m symbol=#pleaseHelp])."
]]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5
MsgSymmetrischema
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.Msg
false
none
location
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.MsgSymmetrischema accessing
location
^location
location: anObject
location := anObject
Agri03
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation areaTotal riego maquinaria semillaPapa rotationVariedad aproFerti almacen
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Agri03
Agri03 representa a los agentes papicultores que tienen un nivel de capacitación o de conocimiento de 3.
Instance Variables:
almacen <SmallInteger> description of almacen
aproFerti <SmallInteger> si=1 y no=0
areaTotal <SmallInteger> description of areaTotal
maquinaria <SmallInteger> si=1 y no=0
nivelFormation <SmallInteger> nivel = 3
riego <SmallInteger> description of riego
rotationVariedad <SmallInteger> description of rotationVariedad
semillaPapa <SmallInteger> description of semillaPapa
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 control
step
"to be completed"
step003
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step03
self alarmCalling.
self readMail.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
self moveIntoAgroPart.
self testManejo.
step03_Part
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
self moveIntoAgroPartPart.
self testManejo.
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 pov
pov
^#Agri03.
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 rules
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2.
seuil:=100/self nivelFormation.
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
self patch bufferNumberPhthorimaeaFemale>(seuil) ifTrue:[self patch phthorimaea: self patch phthorimaea*(1-eficacidadTratamientoChimico)].
self patch symmetrischemma>(seuil) ifTrue:[self patch symmetrischemma: self patch symmetrischemma*(1-eficacidadTratamientoChimico)].
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 accessing
almacen
"Getter accessor with default value = 1 "
^almacen ifNil:[almacen := 1]
almacen: anObject
almacen := anObject
aproFerti
"Getter accessor with default value = 1 "
^aproFerti ifNil:[aproFerti := 1]
aproFerti: anObject
aproFerti := anObject
areaTotal
"Getter accessor with default value = 1 "
^areaTotal ifNil:[areaTotal := 1]
areaTotal: anObject
areaTotal := anObject
maquinaria
"Getter accessor with default value = 1 "
^maquinaria ifNil:[maquinaria := 1]
maquinaria: anObject
maquinaria := anObject
nivelFormation
"Getter accessor with default value = 3 "
^nivelFormation ifNil:[nivelFormation := 3]
nivelFormation: anObject
nivelFormation := anObject
riego
"Getter accessor with default value = 1 "
^riego ifNil:[riego := 1]
riego: anObject
riego := anObject
rotationVariedad
"Getter accessor with default value = 1 "
^rotationVariedad ifNil:[rotationVariedad := 1]
rotationVariedad: anObject
rotationVariedad := anObject
semillaPapa
"Getter accessor with default value = 1 "
^semillaPapa ifNil:[semillaPapa := 1]
semillaPapa: anObject
semillaPapa := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Agri03 msg
alarmCalling
"para enviar un mensage a los demas si la polilla mas abundante acerca de un agente es mas alta que una valor dependiente del nivel de percepción de un agente"
| alarm teciaNeighbours phNeighbours symNeighbours bigNeighbours numCeldas agriOnMyCell|
numCeldas := 2.
teciaNeighbours :=0.
phNeighbours :=0.
symNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (200 - (self nivelFormation * 20))].
phNeighbours := self patch neighbourhood select: [:f | f bufferNumberPhthorimaeaFemale > (200 - (self nivelFormation * 20))].
symNeighbours := self patch neighbourhood select: [:f | f bufferNumberSymmetrischemaFemale > (200 - (self nivelFormation * 20))].
teciaNeighbours size > phNeighbours size
ifTrue: [teciaNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := teciaNeighbours]
ifFalse: [bigNeighbours := symNeighbours]]
ifFalse: [phNeighbours size > symNeighbours size
ifTrue: [bigNeighbours := phNeighbours]
ifFalse: [bigNeighbours := symNeighbours]].
agriOnMyCell := IndexedSet new.
1 to: 5 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Agri0', i printString) asSymbol) withinRange: 5)].
bigNeighbours size > numCeldas
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
agriOnMyCell do:
[:x |
alarm location: (Cormas selectRandomlyFrom: bigNeighbours).
alarm receiver: x.
self sendMessageSynchronously: alarm]].
alarmCallingAggregate
| alarmT alarmP alarmS alarm teciaedCell phthedCell symedCell PTMCell aggregateT aggregateP aggregateS aggregate numCellPTM tot|
numCellPTM:=10.
tot:=150.
teciaedCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
phthedCell := self patch neighbourhood detect: [:f | f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
symedCell := self patch neighbourhood detect: [:f | f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))] ifNone: [^nil].
PTMCell := self patch neighbourhood detect: [:f | f bufferNumberTeciaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberPhthorimaeaFemale>(tot-(self nivelFormation*20))
or: [f bufferNumberSymmetrischemaFemale>(tot-(self nivelFormation*20))]]] ifNone: [^nil].
aggregateT := teciaedCell theCSE at: #AggregateTecia.
aggregateP := phthedCell theCSE at: #AggregatePhthorimaea.
aggregateS := symedCell theCSE at: #AggregateSymmetrischema.
aggregate := PTMCell theCSE at: #Aggregate.
aggregate size > numCellPTM
ifTrue:
[alarm := MsgHelp new.
alarm sender: self.
alarm symbol: #alarm.
self acquaintances do:
[:x |
alarm location: (Cormas selectRandomlyFrom: aggregate components).
alarm receiver: x.
self sendMessageAsynchronously: alarm]].
readMail
| aMessage |
aMessage := self nextMessage.
aMessage notNil ifTrue:[
self leave.
self moveTo: aMessage location]
ifFalse: [
self moveIntoAgroPart]
Ag_Isolate_13
CormasNS.Models.SimPolillaSimiatug_v02
CormasNS.Kernel.GroupCommLocation
false
none
nivelFormation learnFromOthers sendMsg getMsg numActions top penality forAchange
SimPolillaSimiatug_v02Category
SimPolillaSimiatug_v02
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_13 init
init
"to be completed. The inherited attributes should have been already initialized"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_13 control
Ag_Isolate_013_readAnswerMercy
self alarmReadingResponseMercy.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_13_readAnswer
self alarmReadingResponse.
"ES = Para conocer el nivel de conocimiento" "US = To know the IPM knowledge"
self updateLearnFromOthers.
self defineNivelFormation.
"ES = Actiones durante una generacion" "US = Process overview"
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_13_readMsgHelpAndAnswer
self readMailAlarmCalling.
Ag_Isolate_13_sendMsgHelp
"ES = Para afectar el nivel de formation de cada agente" "US = To affect the IPM knowledge to each agent"
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
Ag_Isolate_13_withCom
self defineNivelFormation.
self updateNumActions.
self alarmCalling.
self readMailAlarmCalling.
self alarmReadingResponse.
self updateLearnFromOthers.
self defineNivelFormation.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.].
self moveIntoAgroPartPart.
Ag_Isolate_13_withoutCom
self defineNivelFormation.
self numActions=5.
self numActions timesRepeat:[
self moveIntoAgroPartPart.
self testManejo.]
step
"to be completed"
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_13 accessing
forAchange
^forAchange
forAchange: anObject
forAchange := anObject
getMsg
^getMsg
getMsg: anObject
getMsg := anObject
learnFromOthers
^learnFromOthers ifNil:[learnFromOthers:=0]
learnFromOthers: anObject
learnFromOthers := anObject
nivelFormation
^nivelFormation ifNil:[nivelFormation:=0]
nivelFormation: anObject
nivelFormation := anObject
numActions
^numActions ifNil:[numActions:=5]
numActions: anObject
numActions := anObject
penality
^penality ifNil:[penality:= 3].
penality: anObject
penality := anObject
sendMsg
^sendMsg
sendMsg: anObject
sendMsg := anObject
top
^top
top: anObject
top := anObject
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_13 pov
pov
^#Ag_Isolate_13
CormasNS.Models.SimPolillaSimiatug_v02.Ag_Isolate_13 rules
alarmCalling
| teciaNeighbours numCeldas agriOnMyCell m1 stoPerc|
stoPerc:= (self patch stoPec)*(Cormas randomFrom:80 to:120)/100.
numCeldas := 2.
teciaNeighbours :=0.
teciaNeighbours := self patch neighbourhood select: [:f | f bufferNumberTeciaFemale > (stoPerc - (self nivelFormation * self patch stoPec2))].
agriOnMyCell := IndexedSet new.
"13 to: 18 do:[ :i | agriOnMyCell addAll: (self perceivedEntities: (('Ag_Isolate_', i printString) asSymbol) withinRange: 5)]."
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_13 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_14 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_15 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_16 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_17 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
agriOnMyCell:= (self perceivedEntities: #Ag_Isolate_18 withinRange: 5).
teciaNeighbours size > numCeldas and:[self nivelFormation<5 ifTrue:[
m1 := MsgHelp new.
agriOnMyCell do:
[:x |
m1 sender: self.
m1 receiver: x.
m1 symbol: #pleaseHelp.
m1 nivel: self nivelFormation.
m1 ag: 13.
m1 location: (Cormas selectRandomlyFrom: teciaNeighbours).
self sendMessageSynchronously: m1].
self numActions: self penality.]].
alarmReadingResponse
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
self learnFromOthers: (self learnFromOthers + 1).
self top: m2 nivel
]]]].
mailBox:=OrderedCollection new.
alarmReadingResponseMercy
|proba |
proba:=Cormas random.
Cormas random.
mailBox isEmpty ifFalse:[
self mailBox do:[:m2 | m2 symbol = #ok and: [m2 ag > 12 ifTrue:[
proba>0.75
ifTrue:[self learnFromOthers: (self learnFromOthers + 3)]
ifFalse:[proba>0.25
ifTrue:[self learnFromOthers: self learnFromOthers + (Cormas randomFrom: 1 to: 2)]
ifFalse:[self learnFromOthers: (self learnFromOthers + 0)] ].
self top: m2 nivel
] ] ] ].
mailBox:=OrderedCollection new.
defineNivelFormation
self top isNil ifTrue:[self top:5].
self nivelFormation>5 ifTrue:[self nivelFormation: 5].
self nivelFormation>self top ifTrue:[self nivelFormation: self top].
moveIntoAgroPartPart
"ES = Este modulo permitte que los agentes se mueven unicamente al interior del perimetro donde hay cultivos de ciclo corto y adentro de su comunidad." "US = to constrain agents' movements into their territory"
self patch agro=0 ifTrue:
[self randomWalk].
self patch agroPartPart=1 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=1]].
self patch agroPartPart=2 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=2]].
self patch agroPartPart=3 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=3]].
self patch agroPartPart=4 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=4]].
self patch agroPartPart=5 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=5]].
self patch agroPartPart=6 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=6]].
self patch agroPartPart=7 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=7]].
self patch agroPartPart=8 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=8]].
self patch agroPartPart=9 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=9]].
self patch agroPartPart=10 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=10]].
self patch agroPartPart=11 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=11]].
self patch agroPartPart=12 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=12]].
self patch agroPartPart=13 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=13]].
self patch agroPartPart=14 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=14]].
self patch agroPartPart=15 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=15]].
self patch agroPartPart=16 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=16]].
self patch agroPartPart=17 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=17]].
self patch agroPartPart=18 ifTrue: [self randomWalkConstrainedBy: [:f | f agroPartPart=18]].
readMail
| aMessage |
aMessage:= self nextMessage.
self getMsg: self nivelFormation.
"self sendMsg < self getMsg ifTrue:["
aMessage notNil ifTrue:[
self numActions: 2]
ifFalse: [ ]"]"
readMailAlarmCalling
|m2 busy nivelAutre |
mailBox isEmpty ifFalse:[
self mailBox do:[
:m1 | m1 symbol = #pleaseHelp and:[ m1 ag >12 ifTrue:[busy = 1 ifFalse:[
nivelAutre:=m1 nivel.
nivelAutre<self nivelFormation ifTrue:[
"busy:= 1."
m2:=MsgHelpAns new.
m2 sender: self.
m2 receiver: (m1) sender.
m2 symbol: #ok.
m2 ag: 13.
m2 nivel: self nivelFormation.
self sendMessageSynchronously: m2.
self numActions: self penality.
]]]]]]
testManejo
|eficacidadTratamientoChimico seuil|
eficacidadTratamientoChimico:= self nivelFormation*0.2*((Cormas randomFrom:80 to:120)/100).
self nivelFormation=0 ifFalse:[seuil:=100/self nivelFormation.] ifTrue:[seuil:=100].
self patch tecia>(seuil) ifTrue:[self patch tecia: self patch tecia*(1-eficacidadTratamientoChimico)].
updateLearnFromOthers
self forAchange ifNil:[self forAchange: 2].
self learnFromOthers >=self forAchange ifTrue:[self nivelFormation: (self nivelFormation + 1).
self learnFromOthers: 0].
self learnFromOthers >=((self forAchange)*2) ifTrue:[self nivelFormation: (self nivelFormation + 2).
self learnFromOthers: 0].
updateNumActions
self numActions: 5