--
Project repos: github.com/projectmesa
---
You received this message because you are subscribed to the Google Groups "ProjectMesa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectmesa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectmesa/c7d1b7c1-170b-47fa-9db0-0747c07ed6d7%40googlegroups.com.
Have you tried leaving out the else statement completely?
WouterD <wouter.d...@gmail.com> schrieb am Di., 12. Mai 2020, 09:01:
Thanks for your reply!--I tried pass, continue, ... statements but those give 'invalid syntax' errors.
Op dinsdag 12 mei 2020 01:41:26 UTC+2 schreef Tom Pike:Have your tied pass instead of None as below. Its an iterator so you want to skip not add None.self.datacollector = DataCollector(agent_reporters={"Energ": lambda x: x.energy if x.type=='AGV' else pass })
On Monday, May 11, 2020 at 2:35:35 PM UTC-3, WouterD wrote:Hi everyone!
I'm struggling with the data collection for a bar chart. My model consists of several groups of agents and for one of those groups I would like to create a bar chart. However, when collecting the data (see below) the other groups of agents are also being considered, leaving NaN values in the created dataframe. This leads to the model not being displayed.The lines that I'm using to retrieve the agent data (AGV is the agent name) are the following:self.datacollector = DataCollector(agent_reporters={"Energ": lambda x: x.energy if x.type=='AGV' else None })Does someone know a way to work around this issue?Thank you in advance!
Project repos: github.com/projectmesa
---
You received this message because you are subscribed to the Google Groups "ProjectMesa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proje...@googlegroups.com.
def get_energy(agent):
if agent.type == "AGV":
return agent.energy