simulation_plotter module#
- class simulation_plotter.SimulationPlotter(elevator_args=[[0, 9, [<class 'policies.look_policy.LOOKPolicy'>], 10]], distr_type=<class 'distributions.shopping_mall_distribution.ShoppingMallDistribution'>, seed=-1, distr_init=None)#
Bases:
object
Simulation Plotter enables various plottings with the given __init__ parameters as standard parameters.
- Parameters:
elevator_args (list) – List containing all elevator arguments.
distr_type (Distribution) – The distribution type of the simulation.
seed (int) – The seed for the simulation. If -1, no seed will be used.
distr_init (Distribution, optional) – The distribution object. If None, a new object will be created with the distribution type. If not None, it will be used directly.
- Return type:
None
- distr_plotter_2d(distr, target=False, save_plot=False, name='', combine_floors=None, plot_time=0)#
Plots the distribution of the simulation. The target parameter specifies whether the target or spawn distribution should be plotted. Combine floors specifies which floors should be combined, input a list of indices tuples of ranges. If None, all floors will be plotted individually.
If plot_time=0, only the floor distribution will be plotted. If plot_time=1, only the time distribution will be plotted. If plot_time=2, both will be plotted.
- Parameters:
distr (Distribution) – The distribution to be plotted.
target (bool, optional) – Whether the target or spawn distribution should be plotted.
save_plot (bool, optional) – Whether the plot should be saved or not.
name (str, optional) – The name of the plot.
combine_floors (list, optional) – List of tuples of indices of floors to be combined.
plot_time (int, optional) – Specifies the starting time of the distribution.
- Return type:
None
- param_plotter_2d(obj: list, param: Parameter, start_val, end_val, steps, average_of=1, save_plot=False, name='param_plotter_2d')#
Simulate the parameter param with steps amount of simulations equidistant in [start_val,end_val] The average_of defines how often each step stated above gets executed. The average will be taken to further compute any plots. The list obj contains the metrics which will be plotted and measured during this numerical experiment.
- Parameters:
obj (list) – List of objectives to be plotted.
param (Parameter) – The parameter to be simulated.
start_val (int) – The start value of the simulation.
end_val (int) – The end value of the simulation.
steps (int) – The amount of steps in the simulation.
average_of (int, optional) – The amount of simulations per objective.
save_plot (bool, optional) – Whether the plot should be saved or not.
name (str, optional) – The name of the plot.
- Return type:
None
- param_plotter_3d(obj: Objective, param1: list, param2: list, average_of=1, save_plot=False, name='')#
Simulate two parameters param1 and param2 with steps amount of simulations equidistant in their respective [start_val,end_val] The average_of defines how often each step stated above gets executed. The average will be taken to further compute any plots. The obj represents the metric which will be plotted and measured during this numerical experiment.
- Parameters:
obj (Objective) – The objective to be plotted.
param1 (list) – The first parameter to be simulated.
param2 (list) – The second parameter to be simulated.
average_of (int, optional) – The amount of simulations per objective.
save_plot (bool, optional) – Whether the plot should be saved or not.
name (str, optional) – The name of the plot.
- Return type:
None
- param_plotter_3d_permutations(obj: Objective, from_val: int, to_val: int, steps: int, avg_of=1)#
Plots all permutations of the parameters in PolicyParameter.
- Parameters:
obj (Objective) – The objective to be plotted.
from_val (int) – The start value of the simulation.
to_val (int) – The end value of the simulation.
steps (int) – The amount of steps in the simulation.
average_of (int, optional) – The amount of simulations per objective.
- Return type:
None
- policy_plotter_2d(objective: Objective, policies: list, time_scale='h', average_of=1, save_plot=False, name='')#
Plots the given objective as benchmark over all given policies. The time_scale specifies how often the objective should be measured. The average_of specifies how often the simulation should be run
- Parameters:
objective (Objective) – The objective to be plotted.
policies (list) – The policies to be compared.
time_scale (str, optional) – The time scale of the objective.
average_of (int, optional) – The amount of simulations per objective.
save_plot (bool, optional) – Whether the plot should be saved or not.
name (str, optional) – The name of the plot.
- Return type:
None
- policy_plotter_2d_scenarios(objective: Objective, policy, scenarios, scenario_names, time_scale='h', average_of=1, save_plot=False, name='')#
Compares the given policy over all given scenarios. The time_scale specifies how often the objective should be measured. The average_of specifies how often the simulation should be run
- Parameters:
objective (Objective) – The objective to be plotted.
policy (Policy) – The policy to be compared.
scenarios (list) – The scenarios to be compared.
scenario_names (list) – The names of the scenarios.
time_scale (str, optional) – The time scale of the objective.
average_of (int, optional) – The amount of simulations per objective.
save_plot (bool, optional) – Whether the plot should be saved or not.
name (str, optional) – The name of the plot.
- Return type:
None