Ejemplo n.º 1
0
def main():
    if len(sys.argv) == 2 and sys.argv[1] == "indexdb":
        eprint("indexdb mode")
        algo("prod")
    else:
        eprint("stdin mode")
        algo("test")
Ejemplo n.º 2
0
Archivo: ia.py Proyecto: Colliotv/Zappy
def main():
	if len(sys.argv) is not 4:
		print("USAGE : ./ia.py [serv] [port] [team]")
	else:
		ia = iaClass()
		ia.connect(sys.argv[1], sys.argv[2])
		ia.launchGame(sys.argv[3])
		algo(ia)
Ejemplo n.º 3
0
def main():
    checkArguments()

    r0 = float(sys.argv[1])
    r5 = float(sys.argv[2])
    r10 = float(sys.argv[3])
    r15 = float(sys.argv[4])
    r20 = float(sys.argv[5])
    n = int(sys.argv[6])

    algo(r0, r5, r10, r15, r20, n)
Ejemplo n.º 4
0
        def __init__(self):
                self.n = 0
                self.steps = 0
#                self.ObjectFinder = ObjectFinder()

                logging.basicConfig(filename = "debug.log",
                                    level = logging.DEBUG,
                                    format = "%(asctime)s.%(msecs)03d - %(funcName)s: %(message)s",
                                    datefmt = "%Y-%m-%d %H:%M:%S"
                                    )
                logging.info('Log file created.')
                
                threading.Thread.__init__(self)

                self.arduino_thread = arduino()
                self.bt_thread = bt()
                self.algo_thread = algo()

                arduinoInit = threading.Thread(target = self.arduino_thread.connect, name = 'arduino_thread')
                btInit = threading.Thread(target = self.bt_thread.connect, name = 'bt_thread')
                algoInit = threading.Thread(target = self.algo_thread.init_connection, name = 'algo_thread')

                arduinoInit.daemon = True
                btInit.daemon = True
                algoInit.daemon = True

                arduinoInit.start()
                btInit.start()
                algoInit.start()

                time.sleep(1)

                while not (self.algo_thread.is_algo_connected() and self.bt_thread.is_bt_connected() and self.arduino_thread.is_arduino_connected()):
                        time.sleep(10)
    def __init__(self):
        self.steps = 0
        #self.camera = camera()
        self.imgCoordinates = []

        logging.basicConfig(
            filename="debug.log",
            level=logging.debug,
            format="%(asctime)s.%(msecs)03d - %(funcName)s: %(message)s",
            datefmt="%Y-%m-%d %H:%M:%S")
        logging.info('Log file created.')

        threading.Thread.__init__(self)

        #self.arduino_thread = arduino()
        #self.bt_thread = bt()
        self.algo_thread = algo()
        self.IR_thread = ir()
        self.IR_lock = threading.Lock()

        #arduinoInit = threading.Thread(target = self.arduino_thread.connect, name = 'arduino_thread')
        #btInit = threading.Thread(target = self.bt_thread.connect, name = 'bt_thread')
        algoInit = threading.Thread(target=self.algo_thread.init_connection,
                                    name='algo_thread')
        IRInit = threading.Thread(target=self.IR_thread.connect,
                                  name='IR_thread')

        #arduinoInit.daemon = True
        #btInit.daemon = True
        algoInit.daemon = True
        IRInit.daemon = True

        #arduinoInit.start()
        #btInit.start()
        algoInit.start()
        IRInit.start()

        time.sleep(1)

        while not (self.algo_thread.is_algo_connected()
                   and self.IR_thread.is_IR_connected()):
            time.sleep(10)
Ejemplo n.º 6
0
Archivo: vis.py Proyecto: lge88/cpo
from kcube import KCube
from algo import *
from pylab import *

if __name__ == '__main__':

    # cubes0 = KCube([(-10, 10)]).subdivide([None])
    cubes0 = KCube([(-10, 10), (-10, 10)]).subdivide([0.5, 0.5])

    vals, ymin, xatymin = algo(eval_fun, cubes0, 200)

    x1s = [t[1] for t in vals]
    x2s = [t[2] for t in vals]
    ys = [t[0] for t in vals]

    # scatter(x1s, ys)
    scatter(x1s, x2s, c=ys)
    show()
Ejemplo n.º 7
0
from kcube import *
from algo import *

if __name__ == '__main__':

  cubes0 = KCube([(-1, 1), (-1, 1)]).subdivide([None, None])

  vals, ymin, xatymin = algo(eval_fun, cubes0, 10)

  x1s = [t[1] for t in vals]
  x2s = [t[2] for t in vals]
  ys = [t[0] for t in vals]
  # scatter(x1s, x2s, c=ys)
Ejemplo n.º 8
0
def main():
	checkArguments()
	params = sys.argv[1:10]
	algo(params)