Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/CyberBattleSim
Path: blob/main/cyberbattle/_env/cyberbattle_chain.py
597 views
1
# Copyright (c) Microsoft Corporation.
2
# Licensed under the MIT License.
3
4
"""CyberBattle environment based on a simple chain network structure"""
5
6
from ..samples.chainpattern import chainpattern
7
from . import cyberbattle_env
8
9
10
class CyberBattleChain(cyberbattle_env.CyberBattleEnv):
11
"""CyberBattle environment based on a simple chain network structure"""
12
13
def __init__(self, size, **kwargs):
14
self.size = size
15
super().__init__(initial_environment=chainpattern.new_environment(size), **kwargs)
16
17
@property
18
def name(self) -> str:
19
return f"CyberBattleChain-{self.size}"
20
21