vUser
Bases: VirtualEntity
Source code in PyCloudSim\entity\v_user.py
user_request: List[vUserRequest]
property
The list of user requests of the vUser.
__init__(at=simulation.now, after=None, label=None)
Create a vUser.
Source code in PyCloudSim\entity\v_user.py
creation()
request_sfc(sfc, priority=0, retry=True, backoff=lambda : random.random(), process_length=100, packet_size=65536, num_packets=1, at=simulation.now, after=None)
Request a vSFC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sfc |
vSFC
|
the requested vSFC. |
required |
priority |
Union[int, Callable]
|
the priority of the user request. Defaults to 0. |
0
|
retry |
Union[bool, Callable]
|
set to true if the user request will repeat untill sucess. Defaults to True. |
True
|
backoff |
_type_
|
the random backoff. Defaults to lambda:random.random(). |
lambda : random()
|
process_length |
Union[int, Callable]
|
the length of generated process. Defaults to 100. |
100
|
packet_size |
Union[int, Callable]
|
the packet size of the packet size. Defaults to 65536. |
65536
|
num_packets |
Union[int, Callable]
|
the number of the packet for this user request. Defaults to 1. |
1
|
at |
Union[int, float, Callable]
|
same as entity. Defaults to simulation.now. |
now
|
after |
Optional[Entity | List[Entity]]
|
same as entity. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_user.py
vUserRequest
Bases: VirtualEntity
Source code in PyCloudSim\entity\v_user.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
backoff
property
Return the backoff of the vUserRequest.
flows: List[WorkFlow]
property
Return the list of WorkFlows of the vUserRequest.
num_packets
property
Return the number of packets
packet_size
property
Return the packet size
priority
property
Return the priority of the vUserRequest.
process_length
property
Return the process length of the vUserRequest.
retry
property
Return the retry of the vUserRequest.
sfc: vSFC
property
Return the vSFC of the vUserRequest.
sfc_id
property
Return the sfc id of the vUserRequest.
user
property
Return the vUser of the vUserRequest.
__init__(user, sfc, priority=0, retry=True, backoff=lambda : random.random(), process_length=100, packet_size=65536, num_packets=1, at=simulation.now, after=None, label=None)
Create a new vUserRequest.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
vUser
|
the vUser. |
required |
sfc |
vSFC
|
the requested vSFC. |
required |
priority |
Union[int, Callable]
|
the priority of the user request. Defaults to 0. |
0
|
retry |
Union[bool, Callable]
|
set to true if repeat untill sucess. Defaults to True. |
True
|
backoff |
_type_
|
the random backoff. Defaults to lambda:random.random(). |
lambda : random()
|
process_length |
Union[int, Callable]
|
the length of the generated process. Defaults to 100. |
100
|
packet_size |
Union[int, Callable]
|
the size of the generated packets. Defaults to 65536. |
65536
|
num_packets |
Union[int, Callable]
|
the number of generated packets. Defaults to 1. |
1
|
at |
int | float | Callable[..., Any]
|
same as entity. Defaults to simulation.now. |
now
|
after |
Entity | List[Entity] | None
|
same as entity. Defaults to None. |
None
|
label |
str | None
|
same as entity. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_user.py
complete()
Complete the user request and engage the termination process.
creation()
fail()
Fail the user request and engage the termination process if no retry is set.
Source code in PyCloudSim\entity\v_user.py
initialize_workflow(delay=0)
Initialize a workflow for the user request.
Source code in PyCloudSim\entity\v_user.py
termination()
WorkFLow
Bases: VirtualEntity
Source code in PyCloudSim\entity\v_user.py
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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
__init__(user, user_request, sfc, process_length=100, packet_size=65536, num_packets=1, priority=0, at=simulation.now, after=None, label=None)
Create a new WorkFlow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user |
vUser
|
the vUser. |
required |
sfc |
vSFC
|
the vSFC. |
required |
process_length |
Union[int, Callable]
|
the process length. Defaults to 100. |
100
|
packet_size |
Union[int, Callable]
|
the packet size. Defaults to 65536. |
65536
|
num_packets |
Union[int, Callable]
|
the number of packet (Do not change the GET/ACK packet). Defaults to 1. |
1
|
priority |
Union[int, Callable]
|
the priority of the workflow. Defaults to 0. |
0
|
retry |
Union[bool, Callable]
|
set true for retrying until complete. Defaults to True. |
required |
retry_delay |
_type_
|
the delay beofore retrying the workflow. Defaults to lambda:random.random(). |
required |
at |
int | float | Callable[..., Any]
|
when the workflow should be created. Defaults to simulation.now. |
now
|
after |
Entity | List[Entity] | None
|
the entity that the workflow must be created after. Defaults to None. |
None
|
label |
str | None
|
short desciption of the workflow. Defaults to None. |
None
|
Source code in PyCloudSim\entity\v_user.py
complete()
COMPLETE the workflow and engage the termination process.
fail()
Fail the workflow and engage the termination process if no retry is set.