ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.autotune
Class Neural2WayLoadBalanceController

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.AbleDefaultAgent
              |
              +--com.ibm.able.autotune.BaseAutotuneController
                    |
                    +--com.ibm.able.autotune.Neural2WayLoadBalanceController
All Implemented Interfaces:
AbleAgent, AbleBean, AbleBeanContainer, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, AbleUserDefinedFunctionManager, AutotuneController, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable

public class Neural2WayLoadBalanceController
extends BaseAutotuneController
implements AutotuneController

This class implements a basic neural controller It features a neural system model that is trained with off-line data and a neural controller that is adapted on-line The model can predict one or more service level metrics given a set of configuration, workload, service level metrics and tuning controls The controller can specify one or more tuning control values given a set of configuration, workload, service levels, and current tuning control metrics How to use this controller .... 1. define the metadata for the model and controller using a text editor NOTE: the field names MUST match the adaptor metric names exactly 2. instantiate a neural controller agent 3. specify the metadata file for the model neural prediction agent 4. specify the metadata file for the controller neural prediction agent 5. Select the metrics ... must be superset of those fields named in the 2 dfn files 6. Select the 2 service level metrics and the target tuning control metric 7. Initialize the controller to generate the 2 prediction agents 8. Go to the model and train it off-line 9. Run the autotune agent

See Also:
Serialized Form

Field Summary
protected  AutotuneAdaptor adaptor
           
protected  double changeInError
           
protected  AbleNeuralPredictionAgent controller
           
static int CONTROLLER_CONTROL_INDEX
           
protected  int controllerControlIndex
           
protected  java.lang.String controllerDataSetFileName
           
protected  double[] controls
           
static java.lang.String DefaultControllerDataSetFileName
           
static java.lang.String DefaultModelDataSetFileName
           
protected  double error
           
protected  double force
           
protected  double lastError
           
protected  AutotuneTuningControlMetric loadBalanceTuningControlMetric
           
protected  AbleNeuralPredictionAgent model
           
static int MODEL_CONTROL_INDEX
           
protected  double modelControlError
           
protected  int modelControlIndex
           
protected  java.lang.String modelDataSetFileName
           
protected  AutotuneServiceLevelMetric serviceLevelMetricA
           
protected  AutotuneServiceLevelMetric serviceLevelMetricB
           
 
Fields inherited from class com.ibm.able.autotune.BaseAutotuneController
selectedMetrics
 
Fields inherited from class com.ibm.able.AbleDefaultAgent
activeDataSource, defaultName, eventConnections, myBeans, numEpochs, processList, processListOK, userDefinedFunctions
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
Neural2WayLoadBalanceController()
           
 
Method Summary
protected  void backPropThroughModel()
          given the errors in the output units back propagate them through the system model and extract the corresponding input deltas
 void computeControlActions()
          compute the control actions for the target system or application by doing a forward pass through the controller neural network
 void computeErrors()
          compute the differences between actual and desired service levels for one or more service level metrics
static java.lang.String Copyright()
          Determine the copyright of this class.
 AutotuneAdaptor getAdaptor()
           
 double getChangeInError()
           
 java.lang.String getControllerDataSetFileName()
           
 double getError()
           
 double getForce()
           
 double getLastError()
           
 AutotuneTuningControlMetric getLoadBalanceTuningControlMetric()
           
 double getModelControlError()
           
 java.lang.String getModelDataSetFileName()
           
 AutotuneServiceLevelMetric getServiceLevelMetricA()
           
 AutotuneServiceLevelMetric getServiceLevelMetricB()
           
 void init()
          Initialize and configure the bean.
 void process()
          do a single control cycle
 void setAdaptor(AutotuneAdaptor adaptor)
          Set the active Adaptor.
 void setControlActions()
          Set the control actions of the target system or application.
 void setControllerDataSetFileName(java.lang.String name)
           
 void setLoadBalanceTuningControlMetric(AutotuneTuningControlMetric metric)
           
 void setModelDataSetFileName(java.lang.String name)
           
 void setServiceLevelMetricA(AutotuneServiceLevelMetric metric)
           
 void setServiceLevelMetricB(AutotuneServiceLevelMetric metric)
           
protected  void trainController()
          use the errors computed by back propagating through the system model to adjust the controller neural network
 
Methods inherited from class com.ibm.able.autotune.BaseAutotuneController
getLogData, getLogDataFileName, getSelectedMetrics, isLogData, setLogData, setLogDataFileName, setSelectedMetrics
 
Methods inherited from class com.ibm.able.AbleDefaultAgent
addBean, addBeans, addEventConnection, addUserDefinedFunction, buildProcessList, clsNm, containsBean, containsBean, containsUserDefinedFunction, debugTrace, generateUniqueName, getBean, getBeans, getDataSource, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, invokeUserDefinedFunction, isActiveDataSource, propertyChange, quitAll, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, reset, resumeAll, setActiveDataSource, setDataFlowEnabled, setProcessList, setUserDefinedFunctions, suspendAll
 
Methods inherited from class com.ibm.able.AbleObject
addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.able.AbleBean
getComment, getLogger, getName, getParent, getState, getTraceLogger, init, isChanged, process, setChanged, setComment, setLogger, setName, setParent, setState, setTraceLogger
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer
 
Methods inherited from interface com.ibm.able.AbleEventListenerManager
addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener
 
Methods inherited from interface com.ibm.able.AbleEventQueueManager
flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
processAbleEvent, processNoEventProcessingEnabledSituation, processTimerEvent
 
Methods inherited from interface com.ibm.able.AblePropertyChangeManager
addPropertyChangeListener, addPropertyConnection, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection
 
Methods inherited from interface com.ibm.able.AbleSerializable
getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName
 
Methods inherited from interface com.ibm.able.AbleBeanContainer
getName
 

Field Detail

MODEL_CONTROL_INDEX

public static final int MODEL_CONTROL_INDEX

CONTROLLER_CONTROL_INDEX

public static final int CONTROLLER_CONTROL_INDEX

modelControlIndex

protected int modelControlIndex

controllerControlIndex

protected int controllerControlIndex

adaptor

protected AutotuneAdaptor adaptor

controller

protected AbleNeuralPredictionAgent controller

model

protected AbleNeuralPredictionAgent model

DefaultModelDataSetFileName

public static final java.lang.String DefaultModelDataSetFileName

modelDataSetFileName

protected java.lang.String modelDataSetFileName

DefaultControllerDataSetFileName

public static final java.lang.String DefaultControllerDataSetFileName

controllerDataSetFileName

protected java.lang.String controllerDataSetFileName

controls

protected double[] controls

lastError

protected double lastError

error

protected double error

changeInError

protected double changeInError

force

protected double force

modelControlError

protected double modelControlError

serviceLevelMetricA

protected AutotuneServiceLevelMetric serviceLevelMetricA

serviceLevelMetricB

protected AutotuneServiceLevelMetric serviceLevelMetricB

loadBalanceTuningControlMetric

protected AutotuneTuningControlMetric loadBalanceTuningControlMetric
Constructor Detail

Neural2WayLoadBalanceController

public Neural2WayLoadBalanceController()
                                throws AbleException
Method Detail

setModelDataSetFileName

public void setModelDataSetFileName(java.lang.String name)

getModelDataSetFileName

public java.lang.String getModelDataSetFileName()

setControllerDataSetFileName

public void setControllerDataSetFileName(java.lang.String name)

getControllerDataSetFileName

public java.lang.String getControllerDataSetFileName()

setServiceLevelMetricA

public void setServiceLevelMetricA(AutotuneServiceLevelMetric metric)

getServiceLevelMetricA

public AutotuneServiceLevelMetric getServiceLevelMetricA()

setServiceLevelMetricB

public void setServiceLevelMetricB(AutotuneServiceLevelMetric metric)

getServiceLevelMetricB

public AutotuneServiceLevelMetric getServiceLevelMetricB()

setLoadBalanceTuningControlMetric

public void setLoadBalanceTuningControlMetric(AutotuneTuningControlMetric metric)

getLoadBalanceTuningControlMetric

public AutotuneTuningControlMetric getLoadBalanceTuningControlMetric()

getLastError

public double getLastError()

getError

public double getError()

getChangeInError

public double getChangeInError()

getForce

public double getForce()

getModelControlError

public double getModelControlError()

init

public void init()
          throws AbleException
Description copied from interface: AbleBean
Initialize and configure the bean. The bean's state changes to AbleState.Initiated or AbleState.Waiting.

If the implementation provides property change notification, decide whether to send only one property change event or an event for each property.

A bean implementing AbleBeanContainer may choose to call this method on each bean it contains and accumulate errors from each contained bean.

Overrides:
init in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Throws:
AbleException - If an error occurs.

process

public void process()
             throws AbleException
do a single control cycle
Overrides:
process in class AbleDefaultAgent
Following copied from class: com.ibm.able.AbleDefaultAgent
Throws:
AbleException - If an error occurs. Errors from each contained bean are accumulated.

setAdaptor

public void setAdaptor(AutotuneAdaptor adaptor)
Description copied from interface: AutotuneController
Set the active Adaptor.
Specified by:
setAdaptor in interface AutotuneController
Overrides:
setAdaptor in class BaseAutotuneController

getAdaptor

public AutotuneAdaptor getAdaptor()

backPropThroughModel

protected void backPropThroughModel()
                             throws AbleException
given the errors in the output units back propagate them through the system model and extract the corresponding input deltas

trainController

protected void trainController()
                        throws AbleException
use the errors computed by back propagating through the system model to adjust the controller neural network

computeErrors

public void computeErrors()
                   throws AbleException
compute the differences between actual and desired service levels for one or more service level metrics
Specified by:
computeErrors in interface AutotuneController
Overrides:
computeErrors in class BaseAutotuneController

computeControlActions

public void computeControlActions()
                           throws AbleException
compute the control actions for the target system or application by doing a forward pass through the controller neural network
Specified by:
computeControlActions in interface AutotuneController
Overrides:
computeControlActions in class BaseAutotuneController

setControlActions

public void setControlActions()
                       throws AbleException
Description copied from interface: AutotuneController
Set the control actions of the target system or application.
Specified by:
setControlActions in interface AutotuneController
Overrides:
setControlActions in class BaseAutotuneController

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.


ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003