Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-03


com.sigmadynamics.sdo.support
Class SDApplicationBase

java.lang.Object
  extended by com.sigmadynamics.sdo.support.SDOBase
      extended by com.sigmadynamics.sdo.support.SDApplicationBase

All Implemented Interfaces:
ApplicationInterface, SDOInterface
Direct Known Subclasses:
ApplicationBase

public abstract class SDApplicationBase
extends SDOBase
implements ApplicationInterface

Abstract base class for the Application class in generated code, the most important class of an Inline Service. An Inline Service's lifecycle is managed through this class. The Application (bottommost subclass of SDApplicationBase) serves as the main gateway between the RTD Decision Server and an Inline Service.


Field Summary
protected  AppFactoryInterface appFactory
           

 

Fields inherited from class com.sigmadynamics.sdo.support.SDOBase
description, internalName, sdExternalName

 

Method Summary
protected  boolean calculateControlGroupStatus(double val, double percent)
           
protected  boolean calculateControlGroupStatus(int val, double percent)
           
protected  boolean calculateControlGroupStatus(long val, double percent)
           
protected  boolean calculateControlGroupStatus(java.lang.String val, double percent)
           
protected  boolean checkControlGroupStatus(boolean val)
           
protected  boolean checkControlGroupStatus(int val)
           
protected  boolean checkControlGroupStatus(java.lang.String val)
           
static long currentTimeMillis()
          Overrideable method used to aid in simulation of time
 boolean deleteStudy()
          Deletes the study of the Inline Service containing the calling BatchJob, together with all its contained learning models and associated prediction models.
 boolean determineCG()
           
 int dumpStudy(boolean rewriteCompletedTimeWindows)
          Creates a snapshot of the study that is owned by the Inline Service containing the calling BatchJob.
 int dumpStudy(boolean rewriteCompletedTimeWindows, float minAbsCorrelation, int numberOfBins)
          Creates a snapshot of the study that is owned by the Inline Service containing the calling BatchJob.
 void forceLearning()
          Updates the in-memory learning models of all studies to include the latest available learnings, and persists the updated learning models to the database.
 com.sigmadynamics.batch.BatchAgent getBatchAgent()
           
protected static BatchAgentKernel getBatchAgentKernel()
          overrideable
 ChoiceGroupInterface getChoiceGroup(java.lang.String groupId)
          
 int getDataVersion()
           
 int getDeploymentState()
           
 int getDeploymentVersion()
           
protected static LearningRecordWriterFactory getLearningRecordWriterFactory()
          overrideable
 Metadata getMetadata()
           
 java.lang.String getName()
          Gets the application name.
 int getSessionCount()
           
 java.lang.String getStudyName()
          Get the application's study name.
 long getTimeLastLoaded()
           
 boolean isStoppedOrShuttingDown()
           
protected  PredictorInterface newPredictor(SDModelArray models, Path[] attributePaths, java.lang.String[] attributes)
          Overrideable
protected  RuleCache newRuleCache(java.lang.ClassLoader parent)
          Overrideable RuleCache factory
protected  RuleEvaluator newRuleEvaluator(ApplicationInterface app)
          Overrideable RuleEvaluator factory
 void rebuildPredictionModels()
          Rebuilds prediction models for all studies, so they include all recent learnings.
 void setTimeLastLoaded(long time)
           

 

Methods inherited from class com.sigmadynamics.sdo.support.SDOBase
getDescription, getSDOId, getSDOLabel, getSDOLabelOrId, setDescription, setSDOId, setSDOLabel

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface com.sigmadynamics.sdo.interfaces.ApplicationInterface
cleanUp, deleteChoiceHistory, deleteStatistics, flushStatistics, getDefaultChoices, init

 

Methods inherited from interface com.sigmadynamics.sdo.interfaces.client.SDOInterface
getDescription, getSDOId, getSDOLabel, getSDOLabelOrId

 

Field Detail

appFactory

protected final AppFactoryInterface appFactory

Method Detail

getLearningRecordWriterFactory

protected static LearningRecordWriterFactory getLearningRecordWriterFactory()
overrideable
Since:
3.0

getBatchAgentKernel

protected static BatchAgentKernel getBatchAgentKernel()
overrideable
Since:
3.0

getStudyName

public java.lang.String getStudyName()
Description copied from interface: ApplicationInterface
Get the application's study name.
Specified by:
getStudyName in interface ApplicationInterface
Since:
3.0

determineCG

public boolean determineCG()
Specified by:
determineCG in interface ApplicationInterface

calculateControlGroupStatus

protected boolean calculateControlGroupStatus(java.lang.String val,
                                              double percent)

calculateControlGroupStatus

protected boolean calculateControlGroupStatus(int val,
                                              double percent)

calculateControlGroupStatus

protected boolean calculateControlGroupStatus(long val,
                                              double percent)

calculateControlGroupStatus

protected boolean calculateControlGroupStatus(double val,
                                              double percent)

checkControlGroupStatus

protected boolean checkControlGroupStatus(boolean val)

checkControlGroupStatus

protected boolean checkControlGroupStatus(int val)

checkControlGroupStatus

protected boolean checkControlGroupStatus(java.lang.String val)

getSessionCount

public int getSessionCount()
Specified by:
getSessionCount in interface ApplicationInterface

isStoppedOrShuttingDown

public boolean isStoppedOrShuttingDown()
Specified by:
isStoppedOrShuttingDown in interface ApplicationInterface
Returns:
true if the app is stopped or in the process of shutting down

getName

public java.lang.String getName()
Description copied from interface: ApplicationInterface
Gets the application name.
Specified by:
getName in interface ApplicationInterface
Returns:
application name

getDeploymentVersion

public int getDeploymentVersion()
Specified by:
getDeploymentVersion in interface ApplicationInterface

getDeploymentState

public int getDeploymentState()
Specified by:
getDeploymentState in interface ApplicationInterface

getMetadata

public Metadata getMetadata()
Specified by:
getMetadata in interface ApplicationInterface

currentTimeMillis

public static long currentTimeMillis()
Overrideable method used to aid in simulation of time

Must be threadsafe.

Since:
1.0

getDataVersion

public int getDataVersion()
Specified by:
getDataVersion in interface ApplicationInterface

getChoiceGroup

public ChoiceGroupInterface getChoiceGroup(java.lang.String groupId)
Specified by:
getChoiceGroup in interface ApplicationInterface
See Also:
SDChoiceGroup.findChoiceGroup(String)

getBatchAgent

public com.sigmadynamics.batch.BatchAgent getBatchAgent()
Specified by:
getBatchAgent in interface ApplicationInterface

newPredictor

protected PredictorInterface newPredictor(SDModelArray models,
                                          Path[] attributePaths,
                                          java.lang.String[] attributes)
Overrideable
Since:
3.0

newRuleCache

protected RuleCache newRuleCache(java.lang.ClassLoader parent)
Overrideable RuleCache factory
Since:
3.0

newRuleEvaluator

protected RuleEvaluator newRuleEvaluator(ApplicationInterface app)
Overrideable RuleEvaluator factory
Since:
3.0

getTimeLastLoaded

public long getTimeLastLoaded()

setTimeLastLoaded

public void setTimeLastLoaded(long time)

deleteStudy

public boolean deleteStudy()
Description copied from interface: ApplicationInterface
Deletes the study of the Inline Service containing the calling BatchJob, together with all its contained learning models and associated prediction models.
Specified by:
deleteStudy in interface ApplicationInterface

dumpStudy

public int dumpStudy(boolean rewriteCompletedTimeWindows)
Description copied from interface: ApplicationInterface
Creates a snapshot of the study that is owned by the Inline Service containing the calling BatchJob.

Because this operation could take a long time to execute, the recommended practice is to call it directly from a batch job, or from an Integration Point that was invoked by a batch job. Calling it from an Integration Point that was invoked by a Decision Service web service client would likely cause the web service call to timeout.

This call uses the default tuning attributes, meaning it behaves the same as calling

int dumpStudy(boolean rewriteCompletedTimeWindows, double minAbsCorrelation, int numberOfBins);

with the minAbsCorrelation and numberOfBins parameters set to the values seen in the JMX MBean attributes, ModelSnapshotMinAbsCorrelation (default=.000001) and ModelSnapshotNumberOfBins (default=5), respectively. Refer to the RTD installation guide for information about accessing these MBean attributes.

Specified by:
dumpStudy in interface ApplicationInterface
Parameters:
rewriteCompletedTimeWindows - If true, the snapshot data for completed time windows will be deleted and recreated, even though their contents should not have changed.

dumpStudy

public int dumpStudy(boolean rewriteCompletedTimeWindows,
                     float minAbsCorrelation,
                     int numberOfBins)
Description copied from interface: ApplicationInterface
Creates a snapshot of the study that is owned by the Inline Service containing the calling BatchJob.

Because this operation could take a long time to execute, the recommended practice is to call it directly from a batch job, or from an Integration Point that was invoked by a batch job. Calling it from an Integration Point that was invoked by a Decision Service web service client would likely cause the web service call to timeout.

Specified by:
dumpStudy in interface ApplicationInterface
Parameters:
rewriteCompletedTimeWindows - If true, the snapshot data for completed time windows will be deleted and recreated, even though their contents would not have changed.
minAbsCorrelation - Minimum allowed absolute correlation value permitted in model snapshots. Use 0 for all, but be prepared for a lot of data.
numberOfBins - A hint to the Learning Service for the preferred number of bins to use when writing numeric attribute values to a model snapshot.

forceLearning

public void forceLearning()
Description copied from interface: ApplicationInterface
Updates the in-memory learning models of all studies to include the latest available learnings, and persists the updated learning models to the database.
Specified by:
forceLearning in interface ApplicationInterface

rebuildPredictionModels

public void rebuildPredictionModels()
Description copied from interface: ApplicationInterface
Rebuilds prediction models for all studies, so they include all recent learnings.

This method asks the Learning Service to do the following sequence of activities, and returns after the sequence has finished.

  1. Process all previously unprocessed learning records, by reading them from the database and updating the in-memory learning models to reflect the knowledge encapsulated by the learning records.
  2. Persist the newly updated learning models to the database, for all studies.
  3. Rebuild all prediction models for all studies.
  4. Persist the new prediction models to the database.
  5. Wait for the new prediction models to be loaded into memory, where they will be available for making predictions.
Specified by:
rebuildPredictionModels in interface ApplicationInterface

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-03


Copyright © 2010, 2013, Oracle. All rights reserved.