mirror of
https://github.com/wassname/rl_2d_walker.js.git
synced 2026-10-30 13:40:59 +08:00
fix env interface
This commit is contained in:
1 parent
4be259e31a
commit
d296c91508
1 file changed
+1
-3
@@ -142,12 +142,10 @@ class DDPGAgent {
|
||||
const tfActions = this.ddpg.perturbedPrediction(tfPreviousStep);
|
||||
// Step in the environment with theses actions
|
||||
let mAcions = tfActions.buffer().values;
|
||||
let mReward = this.env.step(mAcions);
|
||||
let [mState, mReward, mDone, info] = this.env.step(mAcions);
|
||||
this.rewardsList.push(mReward);
|
||||
// Get the new observations
|
||||
let mState = this.env.getState();
|
||||
let tfState = tf.tensor2d([mState]);
|
||||
let mDone = 0;
|
||||
if (mReward == -1 && this.config.stopOnRewardError){
|
||||
mDone = 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user