Skip to content

Latest commit

 

History

History
445 lines (252 loc) · 10.4 KB

academy.md

File metadata and controls

445 lines (252 loc) · 10.4 KB

Globals / Academy /

Class: Academy

Class to interact with when creating the environment and updating it.

Hierarchy

  • Academy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new Academy(config?: AcademyConfig): Academy

Defined in reimprove/academy.ts:53

Parameters:

Name Type
config? AcademyConfig

Returns: Academy


Properties

Private agents

agents: Map<string, DQAgent>

Defined in reimprove/academy.ts:48


Private assigments

assigments: Map<string, string>

Defined in reimprove/academy.ts:50


Private config

config: AcademyConfig

Defined in reimprove/academy.ts:53


Private logger

logger: LearningDataLogger

Defined in reimprove/academy.ts:52


Private teachers

teachers: Map<string, Teacher>

Defined in reimprove/academy.ts:49


Accessors

Teachers

get Teachers(): string[]

Defined in reimprove/academy.ts:209

Gives the list of teachers

constructor

Returns: string[]


Methods

OnLearningLessonEnded

OnLearningLessonEnded(teacherName: string, callback: function): void

Defined in reimprove/academy.ts:152

Callback which will be called each time the model's fit ends after the end of the lesson.

constructor

Parameters:

teacherName: string

The target teacher which will call the callback

callback: function

The callback, giving the teacher name

▸ (teacher: string): void

Parameters:

Name Type
teacher string

Returns: void


OnLessonEnded

OnLessonEnded(teacherName: string, callback: function): void

Defined in reimprove/academy.ts:163

Callback called when a lesson is ended

constructor

Parameters:

teacherName: string

The target teacher which will call the callback

callback: function

The callback, giving the teacher name and the index of the just ended lesson.

▸ (teacher: string, lessonNumber: number): void

Parameters:

Name Type
teacher string
lessonNumber number

Returns: void


OnTeachingEnded

OnTeachingEnded(teacherName: string, callback: function): void

Defined in reimprove/academy.ts:174

Callback called when a lesson is ended

constructor

Parameters:

teacherName: string

The target teacher which will call the callback

callback: function

The callback, giving the teacher name

▸ (teacher: string): void

Parameters:

Name Type
teacher string

Returns: void


addAgent

addAgent(config: BuildAgentConfig, name?: string): string

Defined in reimprove/academy.ts:66

Parameters:

Name Type
config BuildAgentConfig
name? string

Returns: string


addRewardToAgent

addRewardToAgent(name: string, reward: number): void

Defined in reimprove/academy.ts:131

Add a reward to an agent, given its name. Be careful to give a reward normalized between -1.0 and 1.0 for an optimal learn.

Parameters:

Name Type Description
name string -
reward number

Returns: void


addTeacher

addTeacher(config?: TeachingConfig, name?: string): string

Defined in reimprove/academy.ts:76

Parameters:

Name Type
config? TeachingConfig
name? string

Returns: string


assignTeacherToAgent

assignTeacherToAgent(agentName: string, teacherName: string): void

Defined in reimprove/academy.ts:86

Parameters:

Name Type
agentName string
teacherName string

Returns: void


createLogger

createLogger(parent: HTMLElement): void

Defined in reimprove/academy.ts:226

If not given in the configuration options in the constructor, you can choose to create the logger here

Parameters:

Name Type Description
parent HTMLElement

Returns: void


getTeacherData

getTeacherData(name: string): TeacherTrackingInformation

Defined in reimprove/academy.ts:218

Used for logs, returning the tracking informations of a teacher, see TeacherTrackingInformation

Parameters:

Name Type
name string

Returns: TeacherTrackingInformation


reset

reset(): void

Defined in reimprove/academy.ts:190

Function resetting everything in the academy, calling first resetTeachersAndAgents, then cleaning everything concerning teachers and agents.

Returns: void


resetTeacherLesson

resetTeacherLesson(teacherName: string): void

Defined in reimprove/academy.ts:200

Resets to 0 the current state of the lesson. It cannot forget

Parameters:

Name Type Description
teacherName string

Returns: void


resetTeachersAndAgents

resetTeachersAndAgents(): void

Defined in reimprove/academy.ts:182

Function to reset everything from teachers and agents (resetting parameters of teachers, and resetting memory and parameters of agents).

Returns: void


setRewardOfAgent

setRewardOfAgent(name: string, reward: number): void

Defined in reimprove/academy.ts:141

In case where you just want to clearly set the agent's current reward for this step.

Parameters:

Name Type Description
name string -
reward number

Returns: void


step

step(inputs: AcademyStepInput[] | AcademyStepInput): Promise<Map<string, number>>

Defined in reimprove/academy.ts:102

A step in the academy, giving the teachers their inputs, and propagating it to agents. Returns a [[Map]] where you just have to pick for each agent's name its decision. At each step all the rewards are reset to 0.

Parameters:

Name Type Description
inputs AcademyStepInput[] | AcademyStepInput You can give only one input as well as an array of inputs.

Returns: Promise<Map<string, number>>


toggleLogs

toggleLogs(memory: boolean): void

Defined in reimprove/academy.ts:236

Method to toggle logs, taking an argument to toggle memory logs.

Parameters:

Name Type Default Description
memory boolean false

Returns: void


toggleTeaching

toggleTeaching(teacher: string, toggle: boolean): void

Defined in reimprove/academy.ts:243

Parameters:

Name Type
teacher string
toggle boolean

Returns: void