def __init__(self, position, velocity, done):
        self.position = position
        self.velocity = velocity

        State.__init__(self,
                       np.concatenate((position, velocity), axis=0),
                       is_terminal=done)
Ejemplo n.º 2
0
 def __init__(self, belief_distribution):
     '''
     Args:
         belief_distribution (defaultdict)
     '''
     self.distribution = belief_distribution
     State.__init__(self, data=list(belief_distribution.values()))
Ejemplo n.º 3
0
 def __init__(self, x, x_dot, theta, theta_dot):
     #using round to discretize each component of the state
     self.x = round(x, 1)
     self.x_dot = round(x_dot, 1)
     self.theta = round(theta, 3)
     self.theta_dot = round(theta_dot, 1)
     State.__init__(self, data=[self.x, self.x_dot, self.theta, self.theta_dot])
Ejemplo n.º 4
0
 def __init__(self, belief_distribution):
     '''
     Args:
         belief_distribution (defaultdict)
     '''
     self.distribution = belief_distribution
     State.__init__(self, data=belief_distribution.values())
Ejemplo n.º 5
0
    def __init__(self, x, y, x_dot, y_dot, on_platform_type, is_terminal=False):
        self.x = x
        self.y = y
        self.x_dot = x_dot
        self.y_dot = y_dot
        self.on_platform_type = on_platform_type

        State.__init__(self, data=[self.x, self.y, self.x_dot, self.y_dot, self.on_platform_type], is_terminal=is_terminal)
Ejemplo n.º 6
0
 def __init__(self, x, x_dot, theta, theta_dot):
     #using round to discretize each component of the state
     self.x = round(x, 1)
     self.x_dot = round(x_dot, 1)
     self.theta = round(theta, 3)
     self.theta_dot = round(theta_dot, 1)
     State.__init__(self,
                    data=[self.x, self.x_dot, self.theta, self.theta_dot])
    def __init__(self, observation, is_terminal=False):
        self.position = observation["position"]
        self.velocity = observation["velocity"]
        self.to_target = observation["to_target"]
        data = np.concatenate((self.position, self.velocity, self.to_target),
                              axis=0)

        State.__init__(self, data=data, is_terminal=is_terminal)
    def __init__(self, x, y, xdot, ydot, is_terminal=False):
        self.x = x
        self.y = y
        self.xdot = xdot
        self.ydot = ydot

        data = np.asarray([x, y, xdot, ydot])

        State.__init__(self, data=data, is_terminal=is_terminal)
Ejemplo n.º 9
0
    def __init__(self, objects):
        '''
        Args:
            objects (dict of OOMDPObject instances): {key=object class (str):val = object instances}
        '''
        self.objects = objects
        self.update()

        State.__init__(self, data=self.data)
Ejemplo n.º 10
0
    def __init__(self, objects):
        '''
        Args:
            objects (dict of OOMDPObject instances): {key=object class (str):val = object instances}
        '''
        self.objects = objects
        self.update()

        State.__init__(self, data=self.data)
 def __init__(self, location, photo_block=None):
     """
     :param location: A tuple, the coordinate (x,y,z) of drone
     :param photo_block: A DroneBlock
     """
     self.x = location[0]
     self.y = location[1]
     self.z = location[2]
     self.photo_block = photo_block
     State.__init__(self, data=[location, photo_block])
 def __init__(self, xr, yr, u, r, d, l, xg, yg):
     State.__init__(self, data=[xr, yr, u, r, d, l, xg, yg])
     self.xr = round(xr, 5)
     self.yr = round(yr, 5)
     self.u = u
     self.r = r
     self.d = d
     self.l = l
     self.xg = round(xg, 5)
     self.yg = round(yg, 5)
Ejemplo n.º 13
0
 def __init__(self, x, y, color):
     '''
     Args:
         x (int)
         y (int)
         color (int)
     '''
     State.__init__(self, data=[x, y, color])
     self.x = round(x, 3)
     self.y = round(y, 3)
     self.color = color
Ejemplo n.º 14
0
    def __init__(self, board):
        '''
        init is just the initialiser method that takes in the board of the 
        2048 game.

        Parameters 
        ----------
        board : nparray
            the board represents the 2048 numpy array.
        '''
        State.__init__(self, data=board.flatten().tolist())
        self.board = board
    def __init__(self, robot, doors, rooms, blocks):
        '''
        Args:
            robot (CleanupL1Robot)
            doors (list): list of all the CleanupL1Door objects
            rooms (list): list of all the CleanupL1Room objects
            blocks (list): list of all the CleanupL1Block objects
        '''
        self.robot = robot
        self.doors = doors
        self.rooms = rooms
        self.blocks = blocks

        State.__init__(self, data=[robot, doors, rooms, blocks])
Ejemplo n.º 16
0
 def __init__(self, task, x, y, blocks=[], doors=[], rooms=[]):
     '''
     :param task: The given CleanUpTask
     :param x: Agent x coordinate
     :param y: Agent y coordinate
     :param blocks: List of blocks
     :param doors: List of doors
     :param rooms: List of rooms
     '''
     self.x = x
     self.y = y
     self.blocks = blocks
     self.doors = doors
     self.rooms = rooms
     self.task = task
     State.__init__(self, data=[task, (x, y), blocks, doors, rooms])
Ejemplo n.º 17
0
 def __init__(self, task, x, y, blocks=[], doors=[], rooms=[]):
     '''
     :param task: The given CleanUpTask
     :param x: Agent x coordinate
     :param y: Agent y coordinate
     :param blocks: List of blocks
     :param doors: List of doors
     :param rooms: List of rooms
     '''
     self.x = x
     self.y = y
     self.blocks = blocks
     self.doors = doors
     self.rooms = rooms
     self.task = task
     State.__init__(self, data=[task, (x, y), blocks, doors, rooms])
    def __init__(self, position, theta, velocity, theta_dot, done):
        """
        Args:
            position (np.ndarray)
            theta (float)
            velocity (np.ndarray)
            theta_dot (float)
            done (bool)
        """
        self.position = position
        self.theta = theta
        self.velocity = velocity
        self.theta_dot = theta_dot
        features = [
            position[0], position[1], theta, velocity[0], velocity[1],
            theta_dot
        ]

        State.__init__(self, data=features, is_terminal=done)
 def __init__(self, models):
     State.__init__(self, data=[models])
     self.models = models
Ejemplo n.º 20
0
 def __init__(self, data,is_terminal=False):
     State.__init__(self, data=data, is_terminal=is_terminal)
Ejemplo n.º 21
0
 def __init__(self, x, y):
     State.__init__(self, data=np.asarray([x, y], dtype=int))
     self.x = round(x, 5)
     self.y = round(y, 5)
Ejemplo n.º 22
0
 def __init__(self, x, y, vx, vy):
     State.__init__(self, data=[x, y, vx, vy])
     self.x = round(x, 5)
     self.y = round(y, 5)
     self.vx = vx
     self.vy = vy
Ejemplo n.º 23
0
 def __init__(self, name):
     self.name = name
     is_terminal = name == 'goal'
     State.__init__(self, data=name, is_terminal=is_terminal)
Ejemplo n.º 24
0
 def __init__(self, floor_number, q, is_terminal=False):
     State.__init__(self, data=[floor_number, q], is_terminal=is_terminal)
     self.agent_on_floor_number = floor_number
     self.q = q  # logic state
 def __init__(self, num):
     State.__init__(self, data=num)
     self.num = num
Ejemplo n.º 26
0
 def __init__(self, x, y, color):
     self.color = color
     State.__init__(self, data=[x, y, color])
     self.x = round(x, 3)
     self.y = round(y, 3)
Ejemplo n.º 27
0
 def __init__(self, room_number, is_terminal=False, items=[]):
     State.__init__(self, data=[room_number], is_terminal=is_terminal)
     self.agent_in_room_number = room_number
     self.items = items
Ejemplo n.º 28
0
 def __init__(self, data=[], is_terminal=False):
     self.data = data
     State.__init__(self, data=data, is_terminal=is_terminal)
Ejemplo n.º 29
0
 def __init__(self, data=[], is_terminal=False):
     self.data = data
     State.__init__(self, data=data, is_terminal=is_terminal)
Ejemplo n.º 30
0
 def __init__(self, a_x, a_y, b_x, b_y):
     State.__init__(self, data=[a_x, a_y, b_x, b_y])
     self.a_x = a_x
     self.a_y = a_y
     self.b_x = b_x
     self.b_y = b_y
Ejemplo n.º 31
0
 def __init__(self, x, y, z, q):
     State.__init__(self, data=[x, y, z, q])
     self.x = round(x, 5)
     self.y = round(y, 5)
     self.z = round(z, 5)
     self.q = q
Ejemplo n.º 32
0
 def __init__(self, room_number, is_terminal=False, items=[],goal_type=None):
     State.__init__(self, data=[room_number], is_terminal=is_terminal)
     self.agent_in_room_number = room_number
     self.items = items
     self.goal_type = goal_type
Ejemplo n.º 33
0
 def __init__(self, x, y):
     State.__init__(self, data=[x, y])
     self.x = round(x, 5)
     self.y = round(y, 5)
 def __init__(self, x, y, phi=lambda state: [state.x, state.y]):
     State.__init__(self, data=[x, y])
     self.x = x
     self.y = y
     self.phi = phi
Ejemplo n.º 35
0
 def __init__(self, data=[], is_terminal=False, level=0):
     self.level = level
     State.__init__(self, data=data, is_terminal=is_terminal)
Ejemplo n.º 36
0
 def __init__(self, x, y):
     State.__init__(self, data=[x, y])
     self.x = round(x, 5)
     self.y = round(y, 5)
Ejemplo n.º 37
0
 def __init__(self, room_number, q, is_terminal=False):
     State.__init__(self, data=[room_number, q], is_terminal=is_terminal)
     self.agent_in_room_number = room_number
     self.q = q  # logic state
Ejemplo n.º 38
0
 def __init__(self, a_x, a_y, b_x, b_y):
     State.__init__(self, data=[a_x, a_y, b_x, b_y])
     self.a_x = a_x
     self.a_y = a_y
     self.b_x = b_x
     self.b_y = b_y