SimPy : Generate Expert Demonstrations

Classes and Functions

generate_expert_demonstrations_ieee123.expert_rollouts(env, episodes, rtrs_comp, _expert=True)

This function performs roll-outs on the environment to obtain trajectory samples

Parameters
  • env (gym.Env) – The Simpy cyber RL environment

  • episodes (int) – number of episodes the rollout to be performed.

  • rtrs_comp (list) – list of routers compromised

  • _expert (bool) – if set true then generate expert trajectories or random trajectories

Returns

average episode length and trajectories/rollouts

Return type

int, Trajectories

generate_expert_demonstrations_ieee123.get_next_child_router(env, packet_drop_rates, pdr_child_nodes_ix)

This function returns available child node in the forward path that have the least packet drop rates

Parameters
  • env (gym.Env) – The Simpy cyber RL environment

  • packet_drop_rates (list) – packet drop rates of the child routers

  • pdr_child_nodes_ix (list) – child router index

Returns

child router selected for forwarding

Return type

ForwardingDevice

generate_expert_demonstrations_ieee123.get_parent_routers(env, comp_rtr_obj)

This function returns the parent router in the forward path based on the compromised router

Parameters
  • env (gym.Env) – The Simpy cyber RL environment

  • comp_rtr_obj (ForwardingDevice) – compromised router

Returns

parent router

Return type

ForwardingDevice