Process
Base class for processes.
Process
Bases: ABC
Base class for active processes.
Source code in src/asimpy/process.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
__init__(env, *args)
Construct a new process by performing common initialization,
calling the user-defined init() method (no underscores),
and registering the coroutine created by the run() method
with the environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Environment
|
simulation environment. |
required |
*args
|
Any
|
to be passed to |
()
|
Source code in src/asimpy/process.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
init(*args, **kwargs)
Default (do-nothing) post-initialization method.
To satisfy type-checking, derived classes must also declare *args
rather than listing specific parameters by name.
Source code in src/asimpy/process.py
34 35 36 37 38 39 40 41 | |
interrupt(cause)
Interrupt this process by raising an Interrupt exception the
next time the process is scheduled to run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cause
|
Any
|
reason for interrupt (attacked to |
required |
Source code in src/asimpy/process.py
43 44 45 46 47 48 49 50 51 | |
run()
abstractmethod
Actions for this process.
Source code in src/asimpy/process.py
53 54 55 56 | |