build/ludorum.js
/** The constructor builds a player that chooses its moves using the
	[flat Monte Carlo game tree search method](http://en.wikipedia.org/wiki/Monte-Carlo_tree_search).
	The parameters may include:

	+ `simulationCount=30`: Maximum amount of simulations performed for each available move at each
		decision.
	+ `timeCap=1000ms`: Time limit for the player to decide.
	+ `horizon=500`: Maximum amount of moves performed in simulations.
	+ `agent`: Player instance used in the simulations. If undefined moves are chosen at random.
		Agents with asynchronous decisions are not supported.
	*/
The constructor builds a player that chooses its moves using the
[flat Monte Carlo game tree search method].
The parameters may include.

+ `simulationCount=30`: Maximum amount of simulations performed for each available move at each
decision.
+ `timeCap=1000ms`: Time limit for the player to decide.
+ `horizon=500`: Maximum amount of moves performed in simulations.
+ `agent`: Player instance used in the simulations. If undefined moves are chosen at random.
Agents with asynchronous decisions are not supported.
The constructor builds a player that chooses its moves using the [ flat Monte Carlo game tree search method ] . The parameters may include . + ` simulationCount = 30 ` : Maximum amount of simulations performed for each available move at each decision . + ` timeCap = 1000ms ` : Time limit for the player to decide . + ` horizon = 500 ` : Maximum amount of moves performed in simulations . + ` agent ` : Player instance used in the simulations . If undefined moves are chosen at random . Agents with asynchronous decisions are not supported .
function MonteCarloPlayer(params) {
		HeuristicPlayer.call(this, params);
		var prototype = Object.getPrototypeOf(this);
		initialize(this, params)
			.number('simulationCount', { defaultValue: prototype.simulationCount, coerce: true })
			.number('timeCap', { defaultValue: prototype.timeCap, coerce: true })
			.number('horizon', { defaultValue: prototype.horizon, coerce: true });
		if (params) switch (typeof params.agent) {
			case 'function': this.agent = new HeuristicPlayer({ heuristic: params.agent }); break;
			case 'object': this.agent = params.agent; break;
			default: this.agent = null;
		}
	}
function MonteCarloPlayer ( params ) { HeuristicPlayer . call ( this , params ) ; var prototype = Object . getPrototypeOf ( this ) ; initialize ( this , params ) . number ( 'simulationCount' , { defaultValue : prototype . simulationCount , coerce : true } ) . number ( 'timeCap' , { defaultValue : prototype . timeCap , coerce : true } ) . number ( 'horizon' , { defaultValue : prototype . horizon , coerce : true } ) ; if ( params ) switch ( typeof params . agent ) { case 'function' : this . agent = new HeuristicPlayer ( { heuristic : params . agent } ) ; break ; case 'object' : this . agent = params . agent ; break ; default : this . agent = null ; } }
The constructor builds a player that chooses its moves using the
[flat Monte Carlo game tree search method](http://en.wikipedia.org/wiki/Monte-Carlo_tree_search).
The constructor builds a player that chooses its moves using the [ flat Monte Carlo game tree search method ] ( http : // en . wikipedia . org / wiki / Monte - Carlo_tree_search ) .