SimPyDSS : Generate Expert Demonstrations¶
Classes and Functions¶
- generate_expert_demonstrations_cps.expert_rollouts(cenv, penv, episodes, _expert=True)¶
This function performs roll-outs on the mixed-domain environment to obtain trajectory samples
- Parameters
cenv (gym.Env) – The Simpy cyber RL environment
penv (gym.Env) – The OpenDSS RL environment
episodes (int) – number of episodes the rollout to be performed.
_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_cps.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_cps.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