StepSim is a lightweight step-based simulation module written in Python. It can do simple real-time simulations of discrete systems. StepSim supports step-by-step simulation or can run until a break condition occurs. Simulations are made up of containers and converters. A container stores a discrete amount of units of a certain type. A converter draws units from one or more containers and delivers the result to another container. StepSim does not even attempt to do any parallel processing. It processes converters round-robin in a fixed order.
|Operating Systems||POSIX Windows Mac OS X|
Release Notes: This release fixes several bugs in milestones(), and makes logging more verbose. Converters can be compared for equality now. Converter.revert() no longer uses the Container.deliver() method to return items in order for them not being counted as delivered. Converter.draw() no longer checks how many units have been delivered, but how many would be delivered in the next step, and will refuse to draw when this would exceed Converter.max_units. Simulation.save_dot() now groups equivalent converters to a single graph node.
Release Notes: This release adds STDERR_FORMATTER for STDERR_HANDLER for more distinguishable output to STDERR. It has more verbose logging. Converter.set_temporary_steps() now applies the change at once, changing Converter.countdown. Converter.set_temporary_steps() will no longer change any values if a temporary change is already active, and returns False instead. Converter.process() now restores Converter.countdown when the temporary countdown has passed. Simulation.__repr__() also includes all containers and their states. There is an updated doctest example in the README.
Release Notes: This release adds Milestone.converters, uses current_milestone.converters in milestones(), adds Converter.set_temporary_steps(), makes converter.process() and Converter.deliver() temporarily change Converter.steps, adds a doctest for temporarily changing the step value of a Converter to README, and makes minor changes.
Release Notes: This release adds Container.units_delivered, which counts the total number of units delivered to a Container. It changed Milestone.percent() to use Container.units_delivered instead of Container.stock. It adds Converter.max_units and Converter.units_delivered. Converter.draw() will now check if Converter.units_delivered has reached Converter.max_units before drawing resources. This release adds Converter.set_max_units(). It changes doctests in the README accordingly. Minor changes and additions.
Release Notes: This release removes step() from Converter and replaces it with draw(), process(), and deliver() ,which are called by Simulation.step(). The new methods return True if the Converter's countdown permitted the action, False otherwise.