functionMind_1(){//--- public functions / interface / API ----------------------------------------------------------this.newRun =function(){};this.getAction =function( x )// x is an array of [ ai, aj, ei, ej ]{return(0);// Ignore enemy. Just move randomly };this.endRun =function(){};}functionMind_2(){//--- public functions / interface / API ----------------------------------------------------------this.newRun =function(){};this.getAction =function( x )// x is an array of [ ai, aj, ei, ej ]{return(1);// Ignore enemy. Just move randomly };this.endRun =function(){};}functionMind(){var m1 =newMind_1();var m2 =newMind_2();this.newRun =function(){
m1.newRun();
m2.newRun();};this.getAction =function( state )// State format is defined by each World.{if( randomBoolean())return( m1.getAction(state));elsereturn( m2.getAction(state));};this.endRun =function(){};}