You can simulate whatever you want which consists of resources.
resim reson_file=your_file.reson start_time=timestamp_of_start_time write_every=duration_in_s run_for=duration_in_s
- reson_file: The .reson file containing the simulation setup.
- start_time: The start time of the simulation (in a timestamp format).
- write_every: Interval (in seconds) at which the simulation writes the output to a file.
- run_for: Duration (in seconds) for how long the simulation will run.
The output is written to output.csv every write_every seconds, and the simulation runs for run_for seconds.
The output is a CSV file with the following structure
timestamp, resource_1, resource_2, ...
0, units of resource_1 at 0th s, units of resource_2 at 0th s,
1, units of resource_1 at 1st s, units of resource_2 at 1st s,
The .reson format is a custom, human-readable format used to define the resources and processes for the simulation. The file is parsed at the start of the simulation and converted into Rust objects.
Also, yes it uses identations :)
The .reson file defines two main types of objects: resources and processes.
- resource: Represents an item or entity of value (e.g., money, wood, human labor).
- process: Represents an action that creates or consumes resources (e.g., manufacturing, trading, producing).
It could be anything like money, human, work_hour, wood, etc.
resource_name
resource // Identifier for resource type
unit unit_for_the_resource
max max_amount_for_the_resource // optional
amount starting_amount // optional
life life_of_the_resource [s,h,m,d,w,y] // optional
- unit: Unit of measurement (e.g., count, kg, hours).
- max: Maximum quantity of the resource (optional).
- amount: Initial amount of the resource (optional).
- life: Lifespan of the resource (optional), defined in seconds (s), hours (h), days (d), etc.
Example
# A resource representing pencil machine, max 2 machines
# can be there with life of 5 years for each machine
pencil_machine
resource
unit count
max 2
life 5 y
It could be something which produces/uses resources like manufacturing pencil from wood, purchasing wood, selling pencil, etc.
process_name
process // identifier for process
on_use max_on_use // identifier for on use process
use
resource_1 quantity_of_resource_1
resource_2 quantity_of_resource_2
.
.
produce
resource_1 quantity_of_resource_1
resource_1 quantity_of_resource_2
.
.
catalyze parallel_max // optional
resource_1 quantity_of_resource_1
resource_2 quantity_of_resource_2
.
.
period repeated_time_at_which_process_is_executed [s,h,m,d,w,y]
period_delta delta_after_which_the_process_is_executed [s,h,m,d,w,y]
constraint // optional
[s,h,m,w] at
[s,h,m,w] start-end
.
.
- use: Resources consumed by the process.
- produce: Resources generated by the process.
- catalyze: Additional resources that help catalyze the process (optional). Parallel_max if the process can run in parallel (optional).
- period: The frequency of process execution.
- constraint: Optional constraints that limit when the process can run (e.g., specific hours or days).
Example
# A process which uses 0.7 electirc_intake, 10 wood, 2 graphite
# to generate 10 pencil every second with the help of
# 1 pencil_machine. Process can be parallalized
# with the increase of pencil_machine (max 2)
# Constraints are that it only works
# from mon-fri and from 10am-4pm
manufacture_pencil
process
use
electirc_intake 0.7
wood 10
graphite 2
produce
pencil 10
catalyze 2
pencil_machine 1
period 1 s
constraint
w 1-5
h 10-16