visuals package
Submodules
visuals.visual module
Backend for AGE-ABM Visual Interface @Author Max Hall @Co-Authors Meghan Ireland and Matthew Fleischman
- class visuals.visual.VisualEnv(model)[source]
Bases:
object
This is a base class which will store all the data relating to an instance of creating new visualisations using the GUI this includes storing a dictionary storing visulisation classes
- get_list_visuals()[source]
Gets a list of all visual models added to the model.
Parameters
Returns
- Attributelist[str]
- Returns a list of visual model names
- add_agent_visualisation(vis_name: str, agent_list: list[str], plot_data_type: str, plot_type: str, comp_of_interest: str = None, attr_of_interest: str = None)[source]
Adds agent to visualise to the visuals dictionary.
Parameters
- vis_namestr
The name of visualise agent object.
- agent_listlist[str]
List of agent names that the user would like to compare, the agent name in position 0 is the agent of focus.
- comp_of_intereststr
This is the component of interest for this visualisation
- attr_of_intereststr
This is the attribute of interest for this visualisation
- plot_data_typestr
Specifies the type of data which the visual will show.
- plot_typestr
Specifies the type of plot which will be generated.
Returns
- error termint
- Returns 0 on successReturns 1 if plot_id already exist in the VisualEnvReturns 2 if invalid characters usedReturns 3 if no agent names providedReturns 4 if the plot data type is not a valid optionReturns 5 if the plot data type is not valid for provided agentsReturns 6 is the plot type is not valid
- get_agent_visualisation(vis_name: str)[source]
Gets the VisualiseAgent object of the specified visual agent from the visuals dictionary.
Parameters
- vis_namestr
The name of the visual agent object that must be returned.
Returns
- error termint
- Returns 1 if plot_id doesn’t exist in the VisualEnv yetReturns 2 if invalid characters used
- visuals[vis_name]VisualiseAgent
- Returns the VisualiseAgent object on success
- remove_agent_visualisation(vis_name: str)[source]
Removes the provided visual agent from the visuals dictionary.
Parameters
- vis_namestr
The name of the VisualiseAgent object to be removed.
Returns
- error termint
- Returns 0 on successReturns 1 if plot_id doesn’t exist in the VisualEnv yetReturns 2 if invalid characters used
visuals.visual_classes module
Backend Classes for AGE-ABM Visualising @Author Max Hall @Co-Authors Meghan Ireland and Matthew Fleischman
- class visuals.visual_classes.VisualiseAgent(visual_agent_name: str, compare_agent_list: list[str], plot_data_type: str, plot_type: str, comp_of_interest: str, attr_of_interest: str)[source]
Bases:
object
This class is for agent visualisation purposes and stores details about an agent to visualise its desired plots
- get_visual_agent_name()[source]
Gets the name of the agent to visualise.
Parameters
Returns
- visual_agent_namestr
- Returns name of the agent to return.
- get_compare_agent_list()[source]
Gets the list of agents to be compared to the current visual agent.
Parameters
Returns
- compare_agent_listlist[str]
- Returns list of agent names to compare to be returned.
- get_comp_of_interest()[source]
Gets the str of the comp_of_interest.
Parameters
Returns
- comp_of_intereststr
- Returns comp_of_interest string to be returned.
- get_attr_of_interest()[source]
Gets the str of the attr_of_interest.
Parameters
Returns
attr_of_interest : str
Returns attr_of_interest string to be returned.
visuals.visualutils module
Backend Utility functions for Visualising @Author Max Hall @Co-Authors Meghan Ireland and Matthew Fleischman
- class visuals.visualutils.WriteVisualFiles(model, visualiser)[source]
Bases:
object
This is a base class which will allow us to complete the task of writing to the models visualisation files