demo/js/rldemo.js
function() {
    
      // positional information
      this.p = new Vec(50, 50);
      this.op = this.p; // old position
      this.angle = 0; // direction facing
      
      this.actions = [];
      this.actions.push([1,1]);
      this.actions.push([0.8,1]);
      this.actions.push([1,0.8]);
      this.actions.push([0.5,0]);
      this.actions.push([0,0.5]);
      
      // properties
      this.rad = 10;
      this.eyes = [];
      for(var k=0;k<9;k++) { this.eyes.push(new Eye((k-3)*0.25)); }
      
      // braaain
      //this.brain = new deepqlearn.Brain(this.eyes.length * 3, this.actions.length);
      var spec = document.getElementById('qspec').value;
      eval(spec);
      this.brain = brain;
      
      this.reward_bonus = 0.0;
      this.digestion_signal = 0.0;
      
      // outputs on world
      this.rot1 = 0.0; // rotation speed of 1st wheel
      this.rot2 = 0.0; // rotation speed of 2nd wheel
      
      this.prevactionix = -1;
    }
function() {
    
      // positional information
      this.p = new Vec(50, 50);
      this.op = this.p; // old position
      this.angle = 0; // direction facing
      
      this.actions = [];
      this.actions.push([1,1]);
      this.actions.push([0.8,1]);
      this.actions.push([1,0.8]);
      this.actions.push([0.5,0]);
      this.actions.push([0,0.5]);
      
      // properties
      this.rad = 10;
      this.eyes = [];
      for(var k=0;k<9;k++) { this.eyes.push(new Eye((k-3)*0.25)); }
      
      // braaain
      //this.brain = new deepqlearn.Brain(this.eyes.length * 3, this.actions.length);
      var spec = document.getElementById('qspec').value;
      eval(spec);
      this.brain = brain;
      
      this.reward_bonus = 0.0;
      this.digestion_signal = 0.0;
      
      // outputs on world
      this.rot1 = 0.0; // rotation speed of 1st wheel
      this.rot2 = 0.0; // rotation speed of 2nd wheel
      
      this.prevactionix = -1;
    }
function ( ) { // positional information this . p = new Vec ( 50 , 50 ) ; this . op = this . p ; // old position this . angle = 0 ; // direction facing this . actions = [ ] ; this . actions . push ( [ 1 , 1 ] ) ; this . actions . push ( [ 0.8 , 1 ] ) ; this . actions . push ( [ 1 , 0.8 ] ) ; this . actions . push ( [ 0.5 , 0 ] ) ; this . actions . push ( [ 0 , 0.5 ] ) ; // properties this . rad = 10 ; this . eyes = [ ] ; for ( var k = 0 ; k < 9 ; k ++ ) { this . eyes . push ( new Eye ( ( k - 3 ) * 0.25 ) ) ; } // braaain //this.brain = new deepqlearn.Brain(this.eyes.length * 3, this.actions.length); var spec = document . getElementById ( 'qspec' ) . value ; eval ( spec ) ; this . brain = brain ; this . reward_bonus = 0.0 ; this . digestion_signal = 0.0 ; // outputs on world this . rot1 = 0.0 ; // rotation speed of 1st wheel this . rot2 = 0.0 ; // rotation speed of 2nd wheel this . prevactionix = - 1 ; }
A single agent
A single agent