import numpy as np

class FeatureMap(object):

    def __init__(self, num_sensors, num_primitives, num_actions):
        self.NEW_FEATURE_MARGIN = 0.3
        self.NEW_FEATURE_MIN_SIZE = 0.2

        self.map = []
        self.map.append(np.eye(num_sensors))
        self.map.append(np.eye(num_primitives))
        self.map.append(np.eye(num_actions))


    def add_group(self, group_length):
        self.map.append(np.zeros((1, group_length)))


    def add_feature(self, group, has_dummy, feature):
        """
        Add a feature to group
        """
        self.map[group] = np.vstack((self.map[group], np.transpose(feature)))

        

@@ -542,32 +542,33 @@
 oup%0A        %22%22%22%0A
+%0A
         self.map
@@ -628,19 +628,17 @@
 ature)))
-%0A%0A
         
 %0A
@@ -636,9 +636,93 @@
         
+        %0A        if has_dummy:%0A            self.map%5Bgroup%5D = self.map%5Bgroup%5D%5B1:, :%5D%0A
 %0A

remove dummy entry when adding new feature