fix Grace's name
This commit is contained in:
parent
ecb9cc26e9
commit
9cce168536
4
agent.py
4
agent.py
@ -4,7 +4,7 @@ agent.py - Part of ants project
|
|||||||
This model implements the actual agents on the grid (a.k.a. the ants)
|
This model implements the actual agents on the grid (a.k.a. the ants)
|
||||||
|
|
||||||
License: AGPL 3 (see end of file)
|
License: AGPL 3 (see end of file)
|
||||||
(C) Alexander Bocken, Viviane Fahrni, Grace Kragho
|
(C) Alexander Bocken, Viviane Fahrni, Grace Kagho
|
||||||
"""
|
"""
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import numpy.typing as npt
|
import numpy.typing as npt
|
||||||
@ -16,7 +16,7 @@ class RandomWalkerAnt(Agent):
|
|||||||
energy_0=1,
|
energy_0=1,
|
||||||
chemical_drop_rate_0 : dict[str, float]={"A": 80, "B": 80},
|
chemical_drop_rate_0 : dict[str, float]={"A": 80, "B": 80},
|
||||||
sensitivity_0=0.99,
|
sensitivity_0=0.99,
|
||||||
alpha=0.5, drop_chemical=None,
|
alpha=0.6, drop_chemical=None,
|
||||||
betas : dict[str, float]={"A": 0.0512, "B": 0.0512},
|
betas : dict[str, float]={"A": 0.0512, "B": 0.0512},
|
||||||
sensitivity_decay_rate=0.01,
|
sensitivity_decay_rate=0.01,
|
||||||
sensitivity_max = 1
|
sensitivity_max = 1
|
||||||
|
2
main.py
2
main.py
@ -4,7 +4,7 @@ main.py - Part of ants project
|
|||||||
execute via `python main.py` in terminal or only UNIX: `./main.py`
|
execute via `python main.py` in terminal or only UNIX: `./main.py`
|
||||||
|
|
||||||
License: AGPL 3 (see end of file)
|
License: AGPL 3 (see end of file)
|
||||||
(C) Alexander Bocken, Viviane Fahrni, Grace Kragho
|
(C) Alexander Bocken, Viviane Fahrni, Grace Kagho
|
||||||
"""
|
"""
|
||||||
from model import ActiveWalkerModel
|
from model import ActiveWalkerModel
|
||||||
from agent import RandomWalkerAnt
|
from agent import RandomWalkerAnt
|
||||||
|
5
model.py
5
model.py
@ -5,7 +5,7 @@ This file implements the mesa model on which our ActiveRandomWalkerAnts
|
|||||||
will act
|
will act
|
||||||
|
|
||||||
License: AGPL 3 (see end of file)
|
License: AGPL 3 (see end of file)
|
||||||
(C) Alexander Bocken, Viviane Fahrni, Grace Kragho
|
(C) Alexander Bocken, Viviane Fahrni, Grace Kagho
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -17,8 +17,6 @@ from mesa.datacollection import DataCollector
|
|||||||
from agent import RandomWalkerAnt
|
from agent import RandomWalkerAnt
|
||||||
|
|
||||||
class ActiveWalkerModel(Model):
|
class ActiveWalkerModel(Model):
|
||||||
# TODO: separate food and source into new agents?
|
|
||||||
# TODO: pheromone concentrations as well as agents?
|
|
||||||
def __init__(self, width : int, height : int , num_max_agents : int,
|
def __init__(self, width : int, height : int , num_max_agents : int,
|
||||||
num_initial_roamers : int,
|
num_initial_roamers : int,
|
||||||
nest_position : Coordinate,
|
nest_position : Coordinate,
|
||||||
@ -67,6 +65,7 @@ class ActiveWalkerModel(Model):
|
|||||||
for key in ("A", "B"):
|
for key in ("A", "B"):
|
||||||
field = self.grid.fields[key]
|
field = self.grid.fields[key]
|
||||||
self.grid.fields[key] = field - self.decay_rates[key]*field
|
self.grid.fields[key] = field - self.decay_rates[key]*field
|
||||||
|
# TODO: plot to check whether exponential
|
||||||
|
|
||||||
self.datacollector.collect(self)
|
self.datacollector.collect(self)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ at the same location. The base for this code comes from the MultiGrid class
|
|||||||
in mesa/space.py
|
in mesa/space.py
|
||||||
|
|
||||||
License: AGPL 3 (see end of file)
|
License: AGPL 3 (see end of file)
|
||||||
(C) Alexander Bocken, Viviane Fahrni, Grace Kragho
|
(C) Alexander Bocken, Viviane Fahrni, Grace Kagho
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from sys import dont_write_bytecode
|
from sys import dont_write_bytecode
|
||||||
|
@ -8,7 +8,7 @@ For now it displays ant locations as well as pheromone A
|
|||||||
concentrations on two seperate grids
|
concentrations on two seperate grids
|
||||||
|
|
||||||
License: AGPL 3 (see end of file)
|
License: AGPL 3 (see end of file)
|
||||||
(C) Alexander Bocken, Viviane Fahrni, Grace Kragho
|
(C) Alexander Bocken, Viviane Fahrni, Grace Kagho
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
Loading…
Reference in New Issue
Block a user