def test_to_cplex_lp_file_adj(self): network = MAS.Network(*generate_asymmetric()) network.adjacency_1 = np.array([[0, 1, 1], [1, 0, 0], [1, 0, 0]]) target = np.array([ 0.25, 0.5, 1.]) cost = np.ones((3,3)) coeff, sources = MinAttackSolver(network, target, cost, full_adj=True).min_cost_flow_init() print to_cplex_lp_file(coeff, sources, network.adjacency_1)
def test_to_cplex_lp_file(self): # test if it generates the right string network = MAS.Network(*generate_asymmetric()) target = np.array([ 0.25, 0.5, 1.]) cost = np.ones((3,3)) coeff, sources = MinAttackSolver(network, target, cost).min_cost_flow_init() string = to_cplex_lp_file(coeff, sources, network.full_adjacency)