Dummy Simulator#
network_gym_env.DummySim#
- class network_gym_env.DummySim(env_identity, config_json, client_identity, msg_json)[source]#
A dummy simulator that generate random measurement samples. When the simulation terminates, resume to the env_config.
The simulator will create a new env_sim socket using the env_idenntity and connects to the env_port. The simulator is configured using the config_json file. The first measurement will be send to the client_identity.
Initilize dummy simulator.
- Parameters:
env_identity (str) – the identity of the environement socket
config_json (json) – env configuration
client_identity (str) – the identity of the client socket who started the env
msg_json (json) – msg from the cliet.
Methods#
- network_gym_env.DummySim.generate_dummy_measurement(self, name, tags, num_users)#
Generate random measurement.
- Parameters:
name (str) – the name of measurement
tags (dict) – the tags added to the measurement, e.g., timestamps
num_users (int) – the number of users
- Returns:
json – the measurement results
- network_gym_env.DummySim.start_simulation(self, env_identity, config_json, client_identity)#
Start simulation. Connect to the server using SouthBound API. Report network stats measurment and receive action.
- Parameters:
env_identity (str) – the identity of the environement socket
config_json (json) – env configuration
client_identity (str) – the identity of the client socket who started the env
- network_gym_env.DummySim.run_one_interval(self)#
Running the simulator for one interval.
- Returns:
json – the measurement list