The Environment is used by the processes to present inputs to the Network, and to provide training values for the network as well. At appropriate intervals, the processes will ask the environment for an Event. The event is a snapshot or instance of the environment at a given time. It is up to the environment to generate the appropriate event given an index presented by the processes. Typically, these events are precomputed and the environment simply iterates over the a list of events. Optionally, an environment can perform more complicated event choosing operations and can even modify or generate events on the fly if so desired.
Sometimes the events may need to be further organized into subgroups of events in order to represent groups of events that belong in a particular sequence (see section 11.3 Representing Sequences of Events). Specialized processes like the SequenceEpoch and the SequenceProcess interact with the Environment by asking it for one of these subgroups of Events. The Sequence Epoch allows updating of weights and other operations to occur after the entire "batch" of events in the Event SubGroup has been presented (see section 12.6.1 Processes for Sequences of Events).
In the generic Environment class there are two groups:
Event_Group events
BaseSpec_Group event_specs
.specs
group. This makes environments self-contained
so that they can be loaded and saved independent of the project.
The following functions are defined on the Environment object. Note that a given process will either use the Group model or the Event model of the environment. The group model is for sequences, which are stored in subgroups, and the event model treats the environment just like a flat list of events.
InitEvents()
UpdateAllEvents()
EventCount()
GetEvent(int event_number)
event_number
.
The event number should be between 0 and EventCount()
.
GroupCount()
GetGroup(int group_number)
group_number
, which should be between 0 and GroupCount()
.
ReadText(ostream& strm, EventSpec* espec, TextFmt fmt = NAME_FIRST)
WriteText(istreamm& strm, int pat_no=-1, TextFmt fmt = NAME_FIRST)