Exemple #1
0
 def __init__(self, left_policy):
     Logic.__init__(
         self, left_policy)
     self.dql = Network(
         [23, 50, 1])
     # self.dql.load(
     #     './neuron/weight_7000.npy', './neuron/bias_7000.npy')
     self.dql.load(
         './new_neuron/weight_500.npy', './new_neuron/bias_500.npy')
Exemple #2
0
 def __init__(self, left_policy):
     Logic.__init__(self, left_policy)
     self.phases = [[], [9, 10], [16, 17, 18, 19], [15], [0, 1, 2, 3],
                    [20, 21], [5, 6, 7, 8], [4], [11, 12, 13, 14]]
     self.table_protected = [[1, 5], [2, 6], [3, 7], [4, 8]]
     self.table_prot_perm = [[1, 5, 2, 6], [3, 7, 4, 8]]
     self.ns_dir, self.ew_dir = {
         'left': [1, 5],
         'through': [6, 2]
     }, {
         'left': [3, 7],
         'through': [4, 8]
     }
     self.left_table = [1, 5, 3, 7]
     self.through_table = [6, 2, 8, 4]
     self.direction_threshold = 10
     self.permissive_threshold = 20
     self.protect_threshold = 3  # if in protect mode, change to left/through threshold
     self.getID = {
         0: 'S0',
         1: 'S1',
         2: 'S2',
         3: 'S3',
         4: 'S4',
         5: 'W0',
         7: 'W1',
         8: 'W2',
         9: 'W3',
         10: 'W4',
         11: 'N0',
         12: 'N1',
         13: 'N2',
         14: 'N3',
         15: 'N4',
         16: 'E0',
         18: 'E1',
         19: 'E2',
         20: 'E3',
         21: 'E4'
     }