Documentation ¶
Index ¶
- Constants
- Variables
- func Configuration_Oracle(path string, processChan chan bool, default_target int)
- func MakeConfigRequest(endpoint chan int, percept *Percept)
- func MakeDataRequest(ep chan []DataResponse, req []DataQuery, info []struct{ ... }) *dataRequest
- func Oracle_loop(generator PerceptGenerator, windowLength int)
- func Percept_Oracle(generator func(chan *Percept), windowLength int, processChan chan bool)
- type Action
- func (a *Action) CreateRelation()
- func (a *Action) Delete()
- func (a *Action) GetBurnerState() bool
- func (a *Action) GetHPumpState() bool
- func (a *Action) GetHPumpThrottle() float64
- func (a *Action) GetRelationName() string
- func (a *Action) GetTriangleState() bool
- func (a *Action) GetWPumpState() bool
- func (a *Action) GetWPumpThrottle() float64
- func (a *Action) Insert(val ...interface{})
- func (a *Action) SetBurnerState(v bool)
- func (a *Action) SetHPumpState(v bool)
- func (a *Action) SetHPumpThrottle(v float64)
- func (a *Action) SetTriangleState(v bool)
- func (a *Action) SetWPumpState(v bool)
- func (a *Action) SetWPumpThrottle(v float64)
- func (self *Action) String() string
- func (a *Action) Update(val ...interface{})
- type ActorState
- func (s *ActorState) CompareTo(sPrime State) (means int)
- func (s *ActorState) CreateRelation()
- func (s *ActorState) Delete(val ...interface{})
- func (s *ActorState) Equals(sPrime State) bool
- func (s *ActorState) GetBurnerState() bool
- func (s *ActorState) GetHFrequency() int
- func (s *ActorState) GetHState() bool
- func (s *ActorState) GetRelationName() string
- func (s *ActorState) GetTriangleState() bool
- func (s *ActorState) GetWFrequency() int
- func (s *ActorState) GetWState() bool
- func (s *ActorState) Insert(val ...interface{})
- func (s *ActorState) IsTerminal() bool
- func (s *ActorState) Reward(a *Action, sPrime State) (reward Reward)
- func (s *ActorState) SetTimeStamp(t time.Time)
- func (s *ActorState) String() string
- func (s *ActorState) Successor(a *Action) (sPrime State)
- func (s *ActorState) Update(val ...interface{})
- type Calculation_info
- type ConfigRequester
- type DataQuery
- type DataResponse
- type Percept
- func (p *Percept) CreateRelation()
- func (p *Percept) Delete(val ...interface{})
- func (p *Percept) GetBoilerDelta(successor *Percept) (tempDelta int, recordingDuration time.Duration)
- func (p *Percept) GetKettleDelta(successor *Percept) (tempDelta int, recordingDuration time.Duration)
- func (p *Percept) GetRelationName() string
- func (p *Percept) Insert(val ...interface{})
- func (p *Percept) IsValid() bool
- func (p *Percept) SetTime(t time.Time)
- func (p *Percept) String() string
- func (p *Percept) Update(val ...interface{})
- func (p *Percept) Validate() bool
- type PerceptGenerator
- type Pump
- func (p *Pump) Activate()
- func (p *Pump) Deactivate()
- func (p *Pump) DestructPump()
- func (p *Pump) GetCurrentFreq() float64
- func (p *Pump) GetMaxFreq() float64
- func (p *Pump) GetMinFreq() float64
- func (p *Pump) GetState() (bool, float64)
- func (p *Pump) IsActive() bool
- func (p *Pump) String() string
- func (p *Pump) UpdateFrequencyTo(target float64)
- type Reward
- type RollOut
- type State
- type SystemState
Constants ¶
const ( OFF_FREQ = 0.0 ACC_BASIS = 50.0 )
const ( BURNER_TRANSITION = 7 H_PUMP_FREQ_TRANSITION = 5 W_PUMP_TOGGLE_TRANSITION = 3 H_PUMP_TOGGLE_TRANSITION = 16 TRIANGLE_TRANSITION = 32 SYSTEM_STATE_TABLE = "system_states" )
const (
ACTION_TABLE = "actions"
)
const (
PERCEPT_TABLE = "percepts"
)
Variables ¶
var ( //window []*Percept // sliding window to store the percept history Percept_request_chan chan chan *Percept // channel through which Percept pointer channels can be passed Query_request_chan chan *dataRequest // channel through which dataRequest could be passed Percept_update_chan chan Percept //Configuration_update_chan chan Target @TODO Configuration_request_chan chan *configRequest )
Functions ¶
func Configuration_Oracle ¶
func MakeConfigRequest ¶
func MakeDataRequest ¶
func MakeDataRequest(ep chan []DataResponse, req []DataQuery, info []struct { Sec int Weight float64 }) *dataRequest
Interface function to generate a dataRequest object. @param ep channel for the response to be send through @param req array of DataQuery objects that need to be calculated @param info array of Calculation_info objects where calculation parameters are specified
func Oracle_loop ¶
func Oracle_loop(generator PerceptGenerator, windowLength int)
The oracle maintains a sliding window and in order to perform data queries on the system's history. The main oracle loop sets up the interface channels for interactions with this go routine and starts an infinity loop where it (1.) generates a Percept and updates the sliding window. After the window is updated the interface channels are checked in order to perform calculations and response to requests (from e.g. agents). @param generator a PerceptGenerator function that generates a Percept object @param windowLength the length of the sliding window
func Percept_Oracle ¶
A service routine that establishes a percept sliding window and processes incoming requests from clients (either percept request by main routine or query requests from learners). The service listens at two distinct channels for either type of request. In order to establish the sliding window the service starts a generator and updates the sliding window each time the generator hands over a new Percept.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func (*Action) CreateRelation ¶
func (a *Action) CreateRelation()
func (*Action) GetBurnerState ¶
func (*Action) GetHPumpState ¶
func (*Action) GetHPumpThrottle ¶
func (*Action) GetRelationName ¶
Implementation of relation interface
func (*Action) GetTriangleState ¶
func (*Action) GetWPumpState ¶
func (*Action) GetWPumpThrottle ¶
func (*Action) SetBurnerState ¶
func (*Action) SetHPumpState ¶
func (*Action) SetHPumpThrottle ¶
func (*Action) SetTriangleState ¶
func (*Action) SetWPumpState ¶
func (*Action) SetWPumpThrottle ¶
type ActorState ¶
implements SystemState interface, logger.Logable interface
func (*ActorState) CompareTo ¶
func (s *ActorState) CompareTo(sPrime State) (means int)
func (*ActorState) CreateRelation ¶
func (s *ActorState) CreateRelation()
func (*ActorState) Delete ¶
func (s *ActorState) Delete(val ...interface{})
func (*ActorState) Equals ¶
func (s *ActorState) Equals(sPrime State) bool
func (*ActorState) GetBurnerState ¶
func (s *ActorState) GetBurnerState() bool
implementation of SystemState interface
func (*ActorState) GetHFrequency ¶
func (s *ActorState) GetHFrequency() int
func (*ActorState) GetHState ¶
func (s *ActorState) GetHState() bool
func (*ActorState) GetRelationName ¶
func (s *ActorState) GetRelationName() string
implementation of Logable interface
func (*ActorState) GetTriangleState ¶
func (s *ActorState) GetTriangleState() bool
func (*ActorState) GetWFrequency ¶
func (s *ActorState) GetWFrequency() int
func (*ActorState) GetWState ¶
func (s *ActorState) GetWState() bool
func (*ActorState) Insert ¶
func (s *ActorState) Insert(val ...interface{})
func (*ActorState) IsTerminal ¶
func (s *ActorState) IsTerminal() bool
func (*ActorState) SetTimeStamp ¶
func (s *ActorState) SetTimeStamp(t time.Time)
func (*ActorState) String ¶
func (s *ActorState) String() string
ActorState implements the Stringer interface.
func (*ActorState) Successor ¶
func (s *ActorState) Successor(a *Action) (sPrime State)
func (*ActorState) Update ¶
func (s *ActorState) Update(val ...interface{})
type Calculation_info ¶
type ConfigRequester ¶
type DataResponse ¶
type Percept ¶
type Percept struct { //logger.Relation CurrentTime time.Time OutsideTemp, BoilerMidTemp, BoilerTopTemp, KettleTemp, HForeRunTemp, HReverseRunTemp, WForeRunTemp, WReverseRunTemp, WIntakeTemp *w1.Temperature Valid bool }
func (*Percept) CreateRelation ¶
func (p *Percept) CreateRelation()
func (*Percept) GetBoilerDelta ¶
func (*Percept) GetKettleDelta ¶
func (*Percept) GetRelationName ¶
type PerceptGenerator ¶
A PerceptGenerator is a function that generates a Percept for a given time
type Pump ¶
type Pump struct {
// contains filtered or unexported fields
}
func (*Pump) Deactivate ¶
func (p *Pump) Deactivate()
func (*Pump) DestructPump ¶
func (p *Pump) DestructPump()
func (*Pump) GetCurrentFreq ¶
func (*Pump) GetMaxFreq ¶
func (*Pump) GetMinFreq ¶
func (*Pump) UpdateFrequencyTo ¶
type RollOut ¶
type RollOut func(*Action)
A RollOut is a function responsible for controlling the actors according to an action