Files
simulationexam/brute_force.ipynb
T
2015-12-20 13:57:30 -05:00

9.6 KiB

Use this notebook to generate all the possible network using brute force

In [13]:
%pylab inline
from network.network import is_valid_network, get_number_of_activated_antenna, pp_network
from numpy import mean

def get_all_possible_network(box_size):
    number_of_square = box_size * box_size
    return range(2**number_of_square)

Populating the interactive namespace from numpy and matplotlib
In [14]:
box_size = 4
all_networks = [network for network in get_all_possible_network(box_size) if is_valid_network(network, box_size)]
In [15]:
print(mean(  list(map(get_number_of_activated_antenna, all_networks))  ))
hist(list(map(get_number_of_activated_antenna, all_networks)), bins=100)

None
4.06482982172
In [ ]: