Hardware Component
The HardwareComponent
class is the base class for vCPU, vCPUCore and vNIC. It implements the mandatory abstract functions and property. You can create new physcial component based on this class.
Bases: Entity
Base class for all hardware components.
Source code in PyCloudSim\entity\v_hardware_component.py
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 |
|
failed: bool
property
Return True if the hardware component fails
powered_off: bool
property
Return True if the hardware component is powered off
powered_on: bool
property
Return True if the hardware component is powered on
__init__(label=None, create_at=None, terminate_at=None, precursor=None)
Create a new hardware component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
label |
str | None
|
the short description of this new hardware component. Defaults to None. |
None
|
create_at |
int | float | Callable[..., int] | Callable[..., float] | None
|
when is this hardware component is created. Defaults to None. |
None
|
terminate_at |
int | float | Callable[..., int] | Callable[..., float] | None
|
when this hardware component will be terminated. Defaults to None. |
None
|
precursor |
Entity | List[Entity] | None
|
the other entity that this hardware component must not be created until their termination. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_hardware_component.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
fail(at)
Fail the hardware component
Source code in PyCloudSim\entity\v_hardware_component.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
on_fail()
Called when the hardware component fails
Source code in PyCloudSim\entity\v_hardware_component.py
119 120 121 |
|
on_power_off()
Called when the hardware entity is powered off
Source code in PyCloudSim\entity\v_hardware_component.py
96 97 98 |
|
on_power_on()
Called when the hardware entity is powered on
Source code in PyCloudSim\entity\v_hardware_component.py
69 70 71 |
|
on_termination()
Power off upon termination.
Source code in PyCloudSim\entity\v_hardware_component.py
39 40 41 |
|
power_off(at)
Power off the hardware entity
Source code in PyCloudSim\entity\v_hardware_component.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
power_on(at)
Power on the hardware entity
Source code in PyCloudSim\entity\v_hardware_component.py
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 |
|