Banksim User Generate Model

Author: Changbeom Choi (@cbchoi) Copyright (c) 2014-2020 Handong Global University Copyright (c) 2021-2024 Hanbat National University License: MIT. The full license text is available at: https://github.com/eventsim/pyjevsim/blob/main/LICENSE

This module contains Banksim User Generator Model

class examples.banksim.model.model_user_gen.BankUser(_id: int, s_t: float)[source]

Bases: object

calc_wait_time(w_t: float) None[source]

Calculates the wait time.

Parameters:

w_t (float) – Done time

get_arrival_time() float[source]
Returns:

Arrival time

Return type:

float

get_id() int[source]
Returns:

User ID

Return type:

int

get_service_time() float[source]
Returns:

Service time

Return type:

float

get_wait_time() float[source]
Returns:

Wait time

Return type:

float

set_arrival_time(a_t: float) None[source]
Parameters:

a_t (float) – Arrival time

set_drop_time(d_t: float) None[source]
Parameters:

a_t (float) – Arrival time

class examples.banksim.model.model_user_gen.BankUserGenerator(name)[source]

Bases: BehaviorModel

A Model representing a bank user generator.

ext_trans(port, msg)[source]

Handles external transitions based on the input port.

Parameters:
  • port (str) – The port that received the message

  • msg (SysMessage) – The received message

get_user()[source]
int_trans()[source]

Handles internal transitions based on the current state.

output(msg_deliver)[source]

Generates the output message when in the “GEN” state.

Returns:

The output message

Return type:

SysMessage

set_state_idle()[source]

Banksim Queue Model

Author: Changbeom Choi (@cbchoi) Copyright (c) 2014-2020 Handong Global University Copyright (c) 2021-2024 Hanbat National University License: MIT. The full license text is available at: https://github.com/eventsim/pyjevsim/blob/main/LICENSE

This module contains Banksim Queue Model

class examples.banksim.model.model_queue.BankQueue(name, queue_size, proc_num)[source]

Bases: BehaviorModel

Class representing a bank queue managing users and processors.

ext_trans(port, msg)[source]

Handles external transitions based on the input port.

Parameters:
  • port (str) – The port that received the message

  • msg (SysMessage) – The received message

int_trans()[source]

Handles internal transitions based on the current state.

output(msg_deliver)[source]

Generates the output message when in the “SEND” state.

Returns:

The output message

Return type:

SysMessage

set_proc_num(proc_num)[source]

Sets the number of processors and adjusts the usable processor list.

Parameters:

proc_num (int) – Number of processors

set_queue_size(queue_size)[source]

Sets the maximum size of the queue.

Parameters:

queue_size (int) – Maximum size of the queue

Banksim Accountant Model

Author: Changbeom Choi (@cbchoi) Copyright (c) 2014-2020 Handong Global University Copyright (c) 2021-2024 Hanbat National University License: MIT. The full license text is available at: https://github.com/eventsim/pyjevsim/blob/main/LICENSE

This module contains Banksim Accountant Model

class examples.banksim.model.model_accountant.BankAccountant(name, proc_num)[source]

Bases: BehaviorModel

A Model representing a bank accountant processing bank users.

ext_trans(port, msg)[source]

Handles external transitions based on the input port.

Parameters:
  • port (str) – The port that received the message

  • msg (SysMessage) – The received message

int_trans()[source]

Handles internal transitions based on the current state.

output(msg_deliver)[source]

Generates the output message when in the “PROC” state.

Returns:

The output message

Return type:

SysMessage

Banksim Result Model

Author: Changbeom Choi (@cbchoi) Copyright (c) 2014-2020 Handong Global University Copyright (c) 2021-2024 Hanbat National University License: MIT. The full license text is available at: https://github.com/eventsim/pyjevsim/blob/main/LICENSE

This module contains Banksim User Generator Model

class examples.banksim.model.model_result.BankResult(name, max_user)[source]

Bases: BehaviorModel

A Model representing a bank user generator.

ext_trans(port, msg)[source]

Handles external transitions based on the input port.

Parameters:
  • port (str) – The port that received the message

  • msg (SysMessage) – The received message

get_result()[source]
int_trans()[source]

Defines the internal transition, to be implemented by subclasses

output(msg_deliver)[source]

Defines the output function, to be implemented by subclasses