Beispiel #1
0
import math
import lib601.util as util
import lib601.soarWorld as soarWorld
from soar.io import io
from mazeAnswers import *

import tk
import soarWorld
tk.setInited()

worldname = 'dl9World'
# worldname = 'bigEmptyWorld'

PATH_TO_WORLD = '%s.py' % worldname
world = [i.strip() for i in open('%s.txt' % worldname).readlines()]

bounds = {'dl9World': (0.0,0.0,10.8,10.8),
          'bigEmptyWorld': (0.0,0.0,4.05,4.05)}

def getPath(worldname, maze):
    if worldname == 'dl9World':
        goal_test = lambda (r,c): (r,c) == maze.goal
        return search(maze_successors(maze),maze.start,goal_test)
    else:
        return [util.Point(0.911250, 0.911250), util.Point(1.721250, 0.506250), util.Point(2.531250, 1.316250), util.Point(1.721250, 1.721250), util.Point(0.911250, 2.126250), util.Point(1.721250, 2.936250), util.Point(2.531250, 2.531250)]
        

class RobotMaze(Maze):
    def __init__(self, mapText, x0, y0, x1, y1):
        Maze.__init__(self, mapText) #run Maze's __init__ on this instance
        self.x0 = float(x0)
Beispiel #2
0
import util
from soar.io import io
import colors
import time

import sys
import gw
import dw
reload(dw)
import tk
# this file is for integrating graphics with soar, so we know tk has
# been inited.
tk.setInited()

import traceback


class PlotJob():
    def __init__(self,
                 xname,
                 yname,
                 connectPoints,
                 xfunc=None,
                 yfunc=None,
                 xbounds='auto',
                 ybounds='auto'):
        self.xname = xname
        self.xfunc = xfunc
        self.xbounds = xbounds
        self.yname = yname
        self.yfunc = yfunc