from math import exp,log,sin,cos,pi import pygame import numpy as np from copy import copy import time import sys import os from RocketPhysics import RocketPhysics from RocketController import RocketController from RocketController2 import RocketController2 from RocketControllerLars import RocketControllerLars from RocketControllerLars2 import RocketControllerLars2 RocketControllerClass = RocketControllerLars2 rocket = RocketPhysics() controller = RocketControllerClass(rocket) s_count = 1 rocket.resetScenario(s_count) fps_count = 0 fps_start = time.time() BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) RED = ( 255, 0, 0) # affine transform for drawing def transf(v):
from RocketPhysics import RocketPhysics from RocketController import RocketController from RocketController2 import RocketController2 from RocketControllerLars3 import RocketControllerLars3 rocket = RocketPhysics() controllers = [('RocketController2',RocketController2),('RocketControllerLars3',RocketControllerLars3)] for name,clas in controllers: print '\n'+name+':' score, crashed, timeout = rocket.controllerScore(clas) if crashed: print 'crashed' elif timeout: print 'simulation time exceeded' else: print score