Discrete Event Worker
feral3gp.feral.get_discrete_event_director()
¶
Returns:
Type | Description |
---|---|
The predefined discrete event director of the simulation |
Source code in feral3gp/feral/core/simulation.py
65 66 67 68 69 |
|
feral3gp.feral.EventTriggeredWorker
¶
Bases: JavaDelegate
Event Triggered Workers integrate discrete event behavior/simulation models into a FERAL simulation.
Source code in feral3gp/feral/core/de_worker.py
7 8 9 10 11 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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
create_input_port(port_name)
¶
Create a RxPort with a given name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_name
|
The name of the port |
required |
Returns:
Type | Description |
---|---|
RxPort
|
The created RxPort |
Source code in feral3gp/feral/core/de_worker.py
63 64 65 66 67 68 69 |
|
create_output_port(port_name)
¶
Create a TxPort with a given name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_name
|
The name of the port |
required |
Returns:
Type | Description |
---|---|
The created TxPort |
Source code in feral3gp/feral/core/de_worker.py
71 72 73 74 75 76 77 |
|
delete_timer(timed_event)
¶
Delete a given timer
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timed_event
|
The timer to be deleted |
required |
Source code in feral3gp/feral/core/de_worker.py
118 119 120 121 122 123 |
|
get_console()
¶
Returns:
Type | Description |
---|---|
The console of this worker |
Source code in feral3gp/feral/core/de_worker.py
136 137 138 139 140 |
|
get_director()
¶
Returns:
Type | Description |
---|---|
The director of this worker |
Source code in feral3gp/feral/core/de_worker.py
57 58 59 60 61 |
|
get_input_port(port_name)
¶
Get a RxPort with a given name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_name
|
The name of the port |
required |
Returns:
Type | Description |
---|---|
The RxPort |
Source code in feral3gp/feral/core/de_worker.py
79 80 81 82 83 84 85 |
|
get_input_ports()
¶
Get all RxPorts of this worker
Returns:
Type | Description |
---|---|
The RxPorts |
Source code in feral3gp/feral/core/de_worker.py
87 88 89 90 91 92 |
|
get_output_port(port_name)
¶
Get a TxPort with a given name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port_name
|
The name of the port |
required |
Returns:
Type | Description |
---|---|
The TxPort |
Source code in feral3gp/feral/core/de_worker.py
94 95 96 97 98 99 100 |
|
get_output_ports()
¶
Get all TxPorts of this worker
Returns:
Type | Description |
---|---|
The TxPorts |
Source code in feral3gp/feral/core/de_worker.py
102 103 104 105 106 107 |
|
get_simulation_duration()
¶
Returns:
Type | Description |
---|---|
The simulation duration time in nanoseconds |
Source code in feral3gp/feral/core/de_worker.py
51 52 53 54 55 |
|
get_simulation_time()
¶
Returns:
Type | Description |
---|---|
The current simulation time in nanoseconds |
Source code in feral3gp/feral/core/de_worker.py
45 46 47 48 49 |
|
initialize()
¶
This method will be called by the controlling MOCC during the initialization phase of the simulation
Source code in feral3gp/feral/core/de_worker.py
33 34 35 36 37 |
|
message_received(event, rx_port)
¶
Process a received event over an input port
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
The received event |
required | |
rx_port
|
The port via which the event was received |
required |
Source code in feral3gp/feral/core/de_worker.py
19 20 21 22 23 24 25 |
|
schedule_delta_timer(delay, value)
¶
Schedule a timer at a specific simulation time based on the current time
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delay
|
The delay in nanoseconds after which the timer should run. This is to be understood relative to the current time. |
required | |
value
|
The event data which is set for the created timer |
required |
Returns:
Type | Description |
---|---|
The TimedEvent |
Source code in feral3gp/feral/core/de_worker.py
125 126 127 128 129 130 131 132 133 134 |
|
schedule_timer(time, value)
¶
Schedule a timer at a given absolute simulation time
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time
|
The simulation time in nanoseconds at which the timer shall expire |
required | |
value
|
The event data which is set for the created timer |
required |
Returns:
Type | Description |
---|---|
The TimedEvent |
Source code in feral3gp/feral/core/de_worker.py
109 110 111 112 113 114 115 116 |
|
set_console(console)
¶
Set the console for this worker
Parameters:
Name | Type | Description | Default |
---|---|---|---|
console
|
The console to be set |
required |
Source code in feral3gp/feral/core/de_worker.py
142 143 144 145 146 147 |
|
terminate()
¶
This method will be called by the controlling MOCC during the termination phase of the simulation
Source code in feral3gp/feral/core/de_worker.py
39 40 41 42 43 |
|
timer_expired(timed_event)
¶
A timer has expired. Process the given timed event.
Source code in feral3gp/feral/core/de_worker.py
27 28 29 30 31 |
|