I try to put an function for the calcule of the venta "self.venta += 10" to verifique the model, but the result not change.
Someone can help me! thanks.
class MoneyAgent(mesa.Agent):
def __init__(self, unique_id, model,row):
super().__init__(unique_id, model)
self.empresa = row[0]
self.x_coord = row[1]
self.y_coord = row[2]
self.venta = int(row[3])
self.empleado = int(row[4])
self.zona = row[5]
#defining the owners:
self.owner = False
if unique_id in model.owners:
self.owner = True
def step(self):
self.venta += 10
Not work the function for the increment of "venta", the result not change:
step owner empresa x_coord \
0 0.0 0.0 BELORTA 50.75
1 0.0 0.0 SOCIETE INTERNATIONALE DE PLANTATIONS ET DE FI... 50.06
2 0.0 1.0 PLUKON MOUSCRON 50.29
3 0.0 1.0 SESVANDERHAVE 50.74
4 0.0 1.0 PLUIMVEESLACHTERIJ COOREMAN 50.98
5 1.0 0.0 BELORTA 50.75
6 1.0 0.0 SOCIETE INTERNATIONALE DE PLANTATIONS ET DE FI... 50.06
7 1.0 1.0 PLUKON MOUSCRON 50.29
8 1.0 1.0 SESVANDERHAVE 50.74
9 1.0 1.0 PLUIMVEESLACHTERIJ COOREMAN 50.98
y_coord venta empleado
0 3.40 5900.0 50.0
1 4.63 1500.0 10.0
2 5.82 5000.0 45.0
3 4.70 2500.0 25.0
4 4.97 1000.0 1.0
5 3.40 5900.0 50.0
6 4.63 1500.0 10.0
7 5.82 5000.0 45.0
8 4.70 2500.0 25.0
9 4.97 1000.0 1.0
the poblema is resolved, i forget code to run "model.step()" for i in range(3): model.step() for agent in model.schedule.agents: if isinstance(agent, MoneyAgent): farm_empresa.append([i, agent.empresa]) farm_x_coord.append([i, agent.x_coord]) farm_y_coord.append([i, agent.y_coord]) farm_venta.append([i, agent.venta]) farm_empleado.append([i, agent.empleado]) farm_zona.append([i, agent.zona]) farm_owner.append([i, agent.owner])
step owner empresa x_coord
0 0.0 0.0 BELORTA 50.75
1 0.0 1.0 SOCIETE INTERNATIONALE DE PLANTATIONS ET DE FI... 50.06
2 0.0 0.0 PLUKON MOUSCRON 50.29
3 0.0 1.0 SESVANDERHAVE 50.74
4 0.0 1.0 PLUIMVEESLACHTERIJ COOREMAN 50.98
5 1.0 0.0 BELORTA 50.75
6 1.0 1.0 SOCIETE INTERNATIONALE DE PLANTATIONS ET DE FI... 50.06
7 1.0 0.0 PLUKON MOUSCRON 50.29
8 1.0 1.0 SESVANDERHAVE 50.74
9 1.0 1.0 PLUIMVEESLACHTERIJ COOREMAN 50.98
0 3.40 5910.0 50.0
1 4.63 1510.0 10.0
2 5.82 5010.0 45.0
3 4.70 2510.0 25.0
4 4.97 1010.0 1.0
5 3.40 5920.0 50.0
6 4.63 1520.0 10.0
7 5.82 5020.0 45.0
8 4.70 2520.0 25.0
9 4.97 1020.0 1.0