-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This feature is functional only if the agent records are in the form of ``` {'satisfication': (('A0', 1), ('B0', None), ('A1', 1), ('B1', None), ('A2', 1), ('B2', None)), 'unique_id': (('A0', 'A0'), ('B0', 'B0'), ('A1', 'A1'), ('B1', 'B1'), ('A2', 'A2'), ('B2', 'B2'))} ``` instead of ``` ((1, 'A0', 1, 'A0'), (1, 'B0', None, 'B0'), (1, 'A1', 1, 'A1'), (1, 'B1', None, 'B1'), (1, 'A2', 1, 'A2'), (1, 'B2', None, 'B2')) ``` A more explicit solution instead of implicitly ignoring a group of agents just because of their attribute returns `None`, would be to add a filter to the data collector itself. i.e., instead of ```python agent_records = map(get_reports, model.schedule.agents) ``` we should do ```python agent_records = map(get_reports, filter(agent_filter, model.schedule.agents)) ``` Where `agent_filter` can be `lambda a: isinstance(a, Trader)` . And this, too, is only a few lines of code of change.
- Loading branch information
Showing
3 changed files
with
2 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters