Network_attack_propagation/network_attack_propagation.py

18 lines
368 B
Python
Raw Normal View History

2022-06-16 18:39:16 +02:00
class Node:
def __init__(self):
self.is_infected = False
class Edge:
def __init__(self, node_a: Node, node_b: Node, weight: float):
self.node_a = node_a
self.node_b = node_b
self.weight = weight
class Graph:
def __init__(self):
self.edges = []
def add_edge(self, edge: Edge):
self.edges.append(edge)