datasim.ResourceData

class datasim.ResourceData(world, source_id: str, sample_users: bool = False, frequency: int = 1, plot_options: ~datasim.types.PlotOptions = <datasim.types.PlotOptions object>)

Data source from watching the amount of a Resource.

__init__(world, source_id: str, sample_users: bool = False, frequency: int = 1, plot_options: ~datasim.types.PlotOptions = <datasim.types.PlotOptions object>)

Create a data source from watching the amount of a Resource.

Parameters:
  • world – The World this data belongs to.

  • source_id (Resource) – Source Resource.

  • plot_users (bool, optional) – If True, sample number of users instead of amount.

  • frequency (int, optional) – Frequency in ticks to add data points. Defaults to 1, meaning a point gets added every tick.

  • plot_options (Optional[PlotOptions], optional) – Options for a plot. Defaults to default PlotOptions which means nothing will be plotted.

Methods

__init__(world, source_id[, sample_users, ...])

Create a data source from watching the amount of a Resource.

Attributes

dataset

set_index

source

sample_users

frequency

world

options