histopath_bim_des.process.core moduleο
Common definitions for salabim processes.
- class histopath_bim_des.process.core.ArrivalGenerator(*args, schedule: ArrivalSchedule, env: Model, **kwargs)[source]ο
Bases:
Component
Specimen arrival generator process.
- iteratorο
Iterator yielding the arrival rate for each hourly period.
- Type:
itertools.cycle
- class histopath_bim_des.process.core.ResourceScheduler(*args, resource: Resource, schedule: ResourceSchedule, env: Model, **kwargs)[source]ο
Bases:
Component
Resource scheduler class. The resource level is set every RESOURCE_ALLOCATION_INTERVAL_HOURS hours. The resource level is set to 0 if the day entry in the ResourceSchedule is 0.
- resourceο
The resource to control the allocation of.
- Type:
- scheduleο
The resource schedule in dataclass form.
- Type:
- setup(*, resource: Resource, schedule: ResourceSchedule) None [source]ο
Set up the component, called immediately after initialisation.
- class histopath_bim_des.process.core.BaseProcess(*args, env: Model, **kwargs)[source]ο
Bases:
Component
,ABC
A process with an in-queue. Typically does work on Components arriving to the in-queue and pushes completed components to another processβ in-queue.
- in_queueο
The in-queue of the process from which entities are taken.
- Type:
- class histopath_bim_des.process.core.Process(*args, in_type: Type, fn: Callable[[Component], None], env: Model, **kwargs)[source]ο
Bases:
BaseProcess
A looped processed that takes one entity from its in-queue at a time and activates it.
For example, Process(name=βdo_thisβ, Specimen, do_this) creates Specimen.do_this = do_this and calls it for every arriving Specimen.
- in_queueο
The in-queue of the process from which entities are taken.
- Type:
- histopath_bim_des.process.core.register_process(env: Model, in_type: Type, fn: Callable[[Component], None])[source]ο
Register a process to a simulation environment.
- class histopath_bim_des.process.core.BatchingProcess(*args, batch_size: int | Callable[[], int], out_process: str, env: Model, **kwargs)[source]ο
Bases:
BaseProcess
,Generic
[C
]Takes batch_size entites from in_queue and inserts a single instance of out_type to env.processes[out_process].in_queue.
- batch_sizeο
The batch size or its distribution. Can take salabim distributions or any other type with
__call__
implemented.
- in_queueο
The in-queue of the process from which entities are taken.
- Type:
- class histopath_bim_des.process.core.CollationProcess(*args, counter_name: str, out_process: str, env: Model = None, **kwargs)[source]ο
Bases:
BaseProcess
Takes entities from in_queue and places them into a pool. Once all entities with the same parent are found (based on comparing with a counter), the parent is inserted into env.processes[out_process].in_queue.
- counter_nameο
The name of the counter in the parent entity defining the number of child entities.
- Type:
- in_queueο
The in-queue of the process from which entities are taken.
- Type:
- class histopath_bim_des.process.core.RunnerDurations(collect: float | Distribution, out: float | Distribution, unload: float | Distribution, retur: float | Distribution)[source]ο
Bases:
object
Durations for collecting/unloading the delivery batch and travelling to/from the destination.
- class histopath_bim_des.process.core.DeliveryProcess(*args, runner: Resource, durations: RunnerDurations, out_process: str, env: Model, **kwargs)[source]ο
Bases:
BaseProcess
Takes entities/batches from the in_queue and places them in env.processes[out_process].in_queue, after some delay. A resource is required to move the entity/batch and requires time to travel between the locations associated with the two processes. Batches are unbatched upon arrival.
- runnerο
The resource (e.g. staff) responsible for the delivery.
- Type:
- durationsο
Durations for collecting/unloading the delivery batch and travelling to/from the destination.
- Type:
- setup(runner: Resource, durations: RunnerDurations, out_process: str) None [source]ο
Set up the component, called immediately after initialisation.