config['dynamicInitialStateFlag'] = False
config['dynamicTargetFlag'] = False
config['currentState'] = [15, 15, 0]
config['targetState'] = [10, 15]
config['filetag'] = 'testLong'
config['trajOutputInterval'] = 1
config['trajOutputFlag'] = True
config['customExploreFlag'] = False

with open('config_test.json', 'w') as f:
    json.dump(config, f)

agent.env = ActiveParticleEnv('config_test.json',1)

delta = np.array([[15, 0], [15, 15], [15, -15], [-15, 0], [-15, -15], [-15, 15], [0, -15], [0, 15]])
delta = delta / 1.5
targets = delta + config['currentState'][:2]


nTargets = len(targets)
nTraj = 1
endStep = 100

for j in range(nTargets):
    recorder = []

    for i in range(nTraj):
        print(i)
Example #2
0
#config['Dr'] = 1.63e-13 * 5
#config['Dt'] = 0.49 * 5

config['targetState'] = [15, 15, 25]
config['filetag'] = 'Traj/test'
config['trajOutputFlag'] = True
config['trajOutputInterval'] = 100
config['finishThresh'] = 2
config['gravity'] = 0
config['multiMapNames'] = ['config_RBC_R50_10PerTest.json']
config['multiMapProbs'] = [1.0]

with open('config_test.json', 'w') as f:
    json.dump(config, f)

agent.env = ActiveParticle3DEnv('config_test.json', 1,
                                obstacleConstructorCallBack)

finalTarget = [0, 0, 499]

nTraj = 20
endStep = 500

recorder = []

guide = PathGuiderStraightLine()

for i in range(nTraj):
    print(i)
    guide.reset()
    target = guide.getTrajPos()
    agent.env.config['targetState'] = target
checkpoint = torch.load('Log/Finalepoch2500_checkpoint.pt')
agent.actorNet.load_state_dict(checkpoint['actorNet_state_dict'])

config['dynamicInitialStateFlag'] = False
config['dynamicTargetFlag'] = False
config['currentState'] = [15, 15]
config['targetState'] = [10, 15]
config['filetag'] = 'test'
config['trajOutputInterval'] = 10
config['trajOutputFlag'] = True
config['customExploreFlag'] = False

with open('config_test.json', 'w') as f:
    json.dump(config, f)

agent.env = GoalSelectionEnv('config_test.json',1)

delta = np.array([[15, 0], [15, 15], [15, -15], [-15, 0], [-15, -15], [-15, 15], [0, -15], [0, 15]])
delta = delta / 2 + np.random.randn(8, 2)
targets = delta + config['currentState']


nTargets = len(targets)
nTraj = 1
endStep = 200

for j in range(nTargets):
    recorder = []

    for i in range(nTraj):
        print(i)