@ai-on-browser/data-analysis-models
Version:
Data analysis model package without any dependencies
48 lines (47 loc) • 1.3 kB
TypeScript
/**
* Monte Carlo agent
*/
export default class MCAgent {
/**
* @param {RLEnvironmentBase} env Environment
* @param {number} [resolution] Resolution
*/
constructor(env: RLEnvironmentBase, resolution?: number);
_env: RLEnvironmentBase;
_table: MCTable;
_history: any[];
/**
* Reset agent.
*/
reset(): void;
/**
* Returns a score.
* @returns {Array<Array<Array<number>>>} Score values
*/
get_score(): Array<Array<Array<number>>>;
/**
* Returns a action.
* @param {*[]} state Current states
* @param {number} greedy_rate Greedy rate
* @returns {*[]} Action
*/
get_action(state: any[], greedy_rate?: number): any[];
/**
* Update model.
* @param {*[]} action Action
* @param {*[]} state Next state
* @param {number} reward Reward
* @param {boolean} done Done epoch or not
*/
update(action: any[], state: any[], reward: number, done: boolean): void;
}
import { RLEnvironmentBase } from '../rl/base.js';
declare class MCTable extends QTableBase {
constructor(env: any, resolution?: number, gamma?: number);
_g: any[];
_epoch: number;
_gamma: number;
update(actions: any): void;
}
import { QTableBase } from './q_learning.js';
export {};