def __init__(self, initial, goal=None): '''Inicializacion de nuestro problema.''' Problem.__init__(self, initial, goal) # Las acciones son movimientos de determinadas piezas: # # Movimientos horizontales # a1xa2 # a2xa3 # b1xb2 # b2xb3 # c1xc2 # c2xc3 # # Movimientos verticales # a1xb1 # b1xc1 # a2xb2 # b2xc2 # a3xb3 # b3xc3 self._actions = [ ('a1xa2', (0,0), (0,1)), ('a2xa3', (0,1), (0,2)), ('b1xb2', (1,0), (1,1)), ('b2xb3', (1,1), (1,2)), ('c1xc2', (2,0), (2,1)), ('c2xc3', (2,1),(2,2)), ('a1xb1', (0,0), (1,0)), ('b1xc1', (1,0), (2,0)), ('a2xb2', (0,1), (1,1)), ('b2xc2', (1,1), (2,1)), ('a3xb3', (0,2), (1,2)), ('b3xc3', (1,2),(2,2)) ] self.validStates = [] self.cantidadPastelesRicos = 0
def __init__(self, initial, goal=(3, 3, 0, 0, 0)): """ Define goal state and initialize a problem (3, 3, 0, 0, 0) (M, C, M, C, B) """ self.goal = goal Problem.__init__(self, initial, goal)
def __init__(self, initial, goal=None, cities=None): """The constructor specifies the initial state, and possibly a goal state, if there is a unique goal. Your subclass's constructor can add other arguments.""" self.cities = cities self.nodes_cnt = 0 self.citiy_num = len(cities) self.depth = 0 Problem.__init__(self, initial, goal)
def __init__(self, initial, goal=None, random_h=False): """The constructor specifies the initial state, and possibly a goal state, if there is a unique goal. Your subclass's constructor can add other arguments.""" self.random_h = random_h self.nodes_cnt = 0 self.depth = 0 Problem.__init__(self, initial, goal)
def __init__(self, initial, goal, grid): Problem.__init__(self, initial, goal) """In the constructor we take in the initial state and goal state. """ self.initial = initial self.goal = goal self.grid = grid self.max_speed = (numpy.matrix(self.grid).max())
def __init__(self, inicial=(0, 0), meta=(34, 0), digits=[2, 3], operands=["*", "+"]): Problem.__init__(self, inicial, meta) self.initial = inicial for operand in operands: self.acciones.append(operand) self.digits = digits
def __init__(self, initial, goal=None): """The constructor specifies the initial state, and possibly a goal state, if there is a unique goal. Your subclass's constructor can add other arguments.""" self.nodes_cnt = 0 self.depth = 0 self.states = [(3, 3, 0), (3, 0, 0), (2, 3, 0), (2, 2, 0), (2, 0, 0), (1, 3, 0), (1, 1, 0), (1, 0, 0), (0, 3, 0), (0, 0, 0), (3, 3, 1), (3, 0, 1), (2, 3, 1), (2, 2, 1), (2, 0, 1), (1, 3, 1), (1, 1, 1), (1, 0, 1), (0, 3, 1), (0, 0, 1)] Problem.__init__(self, initial, goal)
def __init__(self, initial, gridSize, maxTime, weight): """ Define goal state and initialize a problem """ self.gridSize = gridSize self.maxTime = maxTime self.numEvents = len( [s for s in initial if isinstance(s, tuple) if 'event' in s]) self.numCars = len( [s for s in initial if isinstance(s, tuple) if 'car' in s]) self.epsilon = 0.01 self.numSteps = 0 self.weight = weight Problem.__init__(self, initial)
def __init__(self, initial, goal=None): """ Define goal state and initialize a problem """ self.goal = goal self.matrix_size = int(math.sqrt(len(initial))) self.total_iterations = 0 self.cars = Queue( self.matrix_size ) # o coada in care salvam ordinea in care se muta masinile self.delta = { 'UP': -self.matrix_size, 'DOWN': self.matrix_size, 'LEFT': -1, 'RIGHT': 1, 'JUMPLEFT': -2, 'JUMPRIGHT': 2, 'JUMPDOWN': 2 * self.matrix_size, 'JUMPUP': -2 * self.matrix_size, 'STAY': 0 } for i in range(1, self.matrix_size + 1): self.cars.put(i) # umplem coada cu masini de la 1 la matrix_size+1 Problem.__init__(self, initial, goal)
def __init__(self, initial, goal, map, diagonal_moves=False, shuffle_actions_list=False): assert(index_by(initial, map) == START) assert(index_by(goal, map) == GOAL) self.map = map self.height = len(map) # number of rows (m) self.width = len(map[0]) # number of columns (n) self.initial = initial self.goal = goal self.diagonal_moves = diagonal_moves self.shuffle_actions_list = shuffle_actions_list if diagonal_moves: self.directions = [(-1, -1), (-1, 0), (-1, 1), ( 0, -1), ( 0, 1), ( 1, -1), ( 1, 0), ( 1, 1)] else: self.directions = [ (-1, 0), ( 0, -1), ( 0, 1), ( 1, 0), ] Problem.__init__(self, self.initial, self.goal)
def __init__(self, N): self.N = N self.initial = tuple([-1] * N) Problem.__init__(self, self.initial)
def __init__(self, initial, goal): self.goal = goal self.initial = initial self.visited_states = [] Problem.__init__(self, self.initial, self.goal)
def __init__(self, initial, goal=None): """Inicializacion de nuestro problema.""" Problem.__init__(self, initial, goal) # cada accion tiene un texto "lindo", y despues una tupla con la # cantidad de misioneros y canibales que se mueven en la canoa self._actions = [("1c", (0, 1)), ("1m", (1, 0)), ("2c", (0, 2)), ("2m", (2, 0)), ("1m1c", (1, 1))]
def __init__(self, initial): size = len(initial) Problem.__init__(self, initial, goal=bytes((1, ) * size)) self.transform_map = build_transform_map(int(sqrt(size))) self._actions = tuple(range(size))
def __init__(self, initial, goal, matrix, heuristic=1): Problem.__init__(self, initial, goal) self.matrix = matrix self.heuristic = heuristic
def __init__(self, initial, goal): Problem.__init__(self, initial, goal) self.all_actions = [ MissionariesLeftToRight(1), MissionariesLeftToRight(2) ]
def __init__(self, inicial=(3, 3, 1), meta=(0, 0, 0), myc=3): Problem.__init__(self, inicial, meta) self.misycan = myc # No. de misioneros = No. de caníbales self.acciones = ['M1M', 'M2M', 'M1C', 'M2C', 'M1M1C'] # acciones posibles
def __init__(self, init_state, final_state, board_size): Problem.__init__(self, init_state, final_state) self.board_size = board_size
def __init__(self, init): #self.old_tables = {} #self.best_value = 0 Problem.__init__(self, get_init_state_from_file(init))
def __init__(self, initial, goal, image): self.initial = initial self.goal = goal self.image = image Problem.__init__(self, initial, goal)
def __init__(self, initial, goal=(1, 2, 3, 4, 5, 6, 7, 8, 0)): """ Define goal state and initialize a problem """ self.goal = goal Problem.__init__(self, initial, goal) self.maxJug = (4, 3)
def __init__(self, domain_problem): self.dp = domain_problem self.goals = {tuple(atom.predicate) for atom in self.dp.goals()} initial = tuple([tuple(atom.predicate) for atom in self.dp.initialstate()]) Problem.__init__(self, initial)
def __init__(self, initial, m, n, x, goal=None): Problem.__init__(self, initial, goal) self.m = m self.n = n self.x = x
def __init__(self, initial=(0, 0), goal=(30, 30), obstacles=(), **kwds): Problem.__init__(self, initial=initial, goal=goal, **kwds) self.obstacles = obstacles - {initial, goal}
def __init__(self, initial, goal, graph, heuristics): Problem.__init__(self, initial, goal) self.graph = graph self.heuristics = heuristics
def __init__(self, initial, goal): Problem.__init__(self, initial, goal)
def __init__(self, init_state, final_state, max_qty): Problem.__init__(self, init_state, final_state) self.max_qty = max_qty
def __init__(self, inicial=(2, 3, 0), meta=(2, 3, 13)): Problem.__init__(self, inicial, meta) self.acciones = ["+A", "+B", "*A", "*B"]
def __init__(self, initial, goal, graph): Problem.__init__(self, initial, goal) self.graph = graph
def __init__(self, initial, goal=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0)): """ Define goal state and initialize a problem """ self.goal = goal Problem.__init__(self, initial, goal)
def __init__(self, initial, goal): self.goal = goal self.initial = initial Problem.__init__(self, self.initial, self.goal)
def __init__(self, initial=[], goal=[], size=5): Problem.__init__(self, initial, goal) self.size = size