Trull

edu.luc.cs.trull.demo.office
Class EconomyControl

java.lang.Object
  extended by edu.luc.cs.trull.EmptyComponent
      extended by edu.luc.cs.trull.TerminatingComponent
          extended by edu.luc.cs.trull.AbstractComponent
              extended by edu.luc.cs.trull.AbstractCombinator
                  extended by edu.luc.cs.trull.Composite
                      extended by edu.luc.cs.trull.demo.office.EconomyControl
All Implemented Interfaces:
Combinator, Component, EventLabels, PropertyChangeSource, Startable, Suspendable, Terminating, java.beans.PropertyChangeListener, java.util.EventListener

public class EconomyControl
extends Composite
implements EventLabels

The economy control logic for an office. Control temporarily reverts to occupant mode while the door is open.

   loop
     await REQUESTTEMP(t) -> { lastTemp = t; }
 |
     await ECONOMYMODE(t) / { economyTemp = t; } ->
     loop
       do
         loop
           do 
             emit SLEEP(economyTemp)
           ; nil
           watching DOOROPEN ->
             do
               emit AWAKE(lastTemp)
             ; nil
             watching DOORCLOSE
       watching OCCUPANTMODE ->
       do
         emit AWAKE(lastTemp)
       ; nil
       watching ECONOMYMODE(t) / { economyTemp = t; }
 


Nested Class Summary
(package private)  class EconomyControl.EmitAwake
           
(package private)  class EconomyControl.EmitSleep
           
(package private)  class EconomyControl.SetEconomyTemp
           
(package private)  class EconomyControl.SetLastTemp
           
 
Nested classes/interfaces inherited from class edu.luc.cs.trull.Composite
Composite.CompositeTerminationListener, Composite.ForwardListener
 
Nested classes/interfaces inherited from class edu.luc.cs.trull.AbstractCombinator
AbstractCombinator.DefaultTerminationListener
 
Field Summary
private  Temp economyTemp
           
private  Temp lastTemp
           
 
Fields inherited from class edu.luc.cs.trull.AbstractCombinator
components
 
Fields inherited from interface edu.luc.cs.trull.demo.office.EventLabels
AWAKE, DOORCLOSE, DOOROPEN, ECONOMYMODE, HEATOFF, HEATON, LIGHTOFF, LIGHTON, OCCUPANTMODE, REQUESTTEMP, SETTEMP, SLEEP, SWITCHOFF, SWITCHON, TEMP
 
Constructor Summary
EconomyControl()
           
 
Method Summary
 
Methods inherited from class edu.luc.cs.trull.Composite
addComponent, getChildTerminationListener, propertyChange, removeComponent, resume, start, stop, suspend
 
Methods inherited from class edu.luc.cs.trull.AbstractCombinator
addComponent, addComponent, getComponent, getComponentCount, getComponents, removeAllComponents, removeComponent
 
Methods inherited from class edu.luc.cs.trull.AbstractComponent
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getExternalListeners, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from class edu.luc.cs.trull.TerminatingComponent
fireTermination, getParent, getTermEvent, scheduleTermination, setTerminationListener
 
Methods inherited from class edu.luc.cs.trull.EmptyComponent
getTerminationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.luc.cs.trull.PropertyChangeSource
addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from interface edu.luc.cs.trull.Terminating
getTerminationListener, setTerminationListener
 

Field Detail

economyTemp

private Temp economyTemp

lastTemp

private Temp lastTemp
Constructor Detail

EconomyControl

public EconomyControl()

Trull

http://www.cs.luc.edu/trull/