parser.add_argument("-g", "--gui", help="set gui mode.", action="store_true")
    parser.add_argument("-t", "--testing", help="set testing mode", action="store_true", default=False)
    parser.add_argument("-cp", "--collect_perception", help="collect the data for perception training")
    parser.add_argument("-ca", "--collect_detector", help="collect the data for detector training")
    parser.add_argument("-p", "--perception", help="set the path of perception neural network")
    parser.add_argument("-e", "--episode", help="set the number of episode", type=int, default=1)

    args = parser.parse_args()

    try:
        os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
        os.environ["CUDA_VISIBLE_DEVICES"]="0"  # specify which GPU(s) to be used
        collect = args_assertions(args)
        env = SetupWorld(mass=1300, wheel_radius=0.04, dt=0.05, collect=collect)
        agent = ddpgAgent(Testing=args.testing)
        input_preprocessor = InputPreprocessor()
        avf=AVF_search()
        stopdist=6.0
        print('Number of episodes :',args.episode)
        for episode in range(args.episode):
         #while stopdist>5.0:
            agnt_number=2000;
            numberofsamples=2000
            initial_distance = np.random.normal(100, 1)
            initial_speed = np.random.normal(38,11)
            #initial_speed = avf.avf_predictor(numberofsamples,agnt_number)
            if initial_speed <1 : initial_speed=1
            friction=np.random.normal(0.7,0.15)
            if friction<=0 : friction=0 
            variance_fric= np.random.normal(0.2,0.06)    # estimate varince between maximum and kinetic friction
            if variance_fric<0 : variance_fric=0
示例#2
0
                        type=int,
                        default=1)

    args = parser.parse_args()

    try:
        os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
        os.environ[
            "CUDA_VISIBLE_DEVICES"] = "0"  # specify which GPU(s) to be used
        collect = args_assertions(args)
        env = SetupWorld(mass=1300,
                         wheel_radius=0.04,
                         dt=0.05,
                         collect=collect)
        agent = ddpgAgent(Testing=args.testing)
        input_preprocessor = InputPreprocessor()
        rcf = rcf(100)
        print('Number of episodes :', args.episode)
        plot = Liveplot()
        cnt = 0
        coDisp = []
        #rcf.trainer()
        for episode in range(args.episode):
            #stopdist=1.0;
            #Comment below 3 lines while training , its only for running set of testing
            #print('***********************************************************************************************************')
            #print('******** Launching failure search test ID:',episode+1)
            #np.random.seed()
            #while stopdist>0:
            ##select parameters---------------------------------------------------------------
            emergency_brake = False