1
0
mirror of https://github.com/gsi-upm/soil synced 2025-11-29 03:18:16 +00:00
* Removed references to `set_state`
* Split some functionality from `agents` into separate files (`fsm` and
`network_agents`)
* Rename `neighboring_agents` to `neighbors`
* Delete some spurious functions
This commit is contained in:
J. Fernando Sánchez
2022-10-17 21:36:21 +02:00
parent 880a9f2a1c
commit 3776c4e5c5
16 changed files with 295 additions and 347 deletions

View File

@@ -69,10 +69,10 @@ class SISaModel(FSM):
return self.content
# Infected
discontent_neighbors = self.count_neighboring_agents(state_id=self.discontent)
discontent_neighbors = self.count_neighbors(state_id=self.discontent)
if self.prob(scontent_neighbors * self.neutral_discontent_infected_prob):
return self.discontent
content_neighbors = self.count_neighboring_agents(state_id=self.content.id)
content_neighbors = self.count_neighbors(state_id=self.content.id)
if self.prob(s * self.neutral_content_infected_prob):
return self.content
return self.neutral
@@ -84,7 +84,7 @@ class SISaModel(FSM):
return self.neutral
# Superinfected
content_neighbors = self.count_neighboring_agents(state_id=self.content.id)
content_neighbors = self.count_neighbors(state_id=self.content.id)
if self.prob(s * self.discontent_content):
return self.content
return self.discontent
@@ -96,9 +96,7 @@ class SISaModel(FSM):
return self.neutral
# Superinfected
discontent_neighbors = self.count_neighboring_agents(
state_id=self.discontent.id
)
discontent_neighbors = self.count_neighbors(state_id=self.discontent.id)
if self.prob(scontent_neighbors * self.content_discontent):
self.discontent
return self.content