Exemplo n.º 1
0
# tests for the game module

import time
import numpy as np
from game import Config, State, StateReader
from test_state import TestState
from test_reader import TestStateReader

config = Config()
config.num_service = 4
config.num_viruses = 1
config.num_datadir = 1
config.num_nodes = 5
config.sparcity = 0.1
config.att_points = 100
config.def_points = 100

config.ratios = np.array([3, 3, 2], dtype=np.int)

# Generate a graph
test_case1 = TestState(config)

# Write the state to file
test_case2 = TestStateReader()
# test_case2.write_state(test_case1.state)

# Read the graph
# test_case1.state = test_case2.read_state()
test_case1.print_graph()
print(test_case1.state.graph_edges)