Copernicus  2.0
 All Classes Namespaces Files Functions Variables
cpc.dataflow.active_inst.ActiveInstance Class Reference
Inheritance diagram for cpc.dataflow.active_inst.ActiveInstance:
cpc.dataflow.value.ValueBase

Public Member Functions

def writeDebug
 
def getStateStr
 
def getState
 
def getPropagatedStateStr
 
def findErrorStates
 
def getFunction
 
def addCputime
 
def getCputime
 
def setCputime
 
def getCumulativeCputime
 
def setState
 
def setSeqNr
 
def getIncreasedSeqNr
 
def getSeqNr
 
def getLog
 
def getBasedir
 
def getFullBasedir
 
def getTasks
 
def getInputs
 
def getStagedInputs
 
def getOutputs
 
def getSubnetInputs
 
def getStagedSubnetInputs
 
def getSubnetOutputs
 
def getInputACP
 
def getOutputACP
 
def getSubnetInputACP
 
def getSubnetOutputACP
 
def getName
 
def getCanonicalName
 
def getNet
 
def removeTask
 
def handleTaskOutput
 
def handleNewInput
 
def resetUpdated
 
def handleNewConnections
 
def getValueAffectedAIs
 
def stageNamedInput
 
def getNamedType
 
def activate
 
def deactivate
 
def unblock
 
def cancelTasks
 
def addTask
 
def markError
 
def setWarning
 
def rerun
 
def writeXML
 
def getSubValue
 
def getCreateSubValue
 
def getClosestSubValue
 
def getSubValueList
 
def getSubValueIterList
 
def hasSubValue
 
def getType
 
def getDesc
 
- Public Member Functions inherited from cpc.dataflow.value.ValueBase
def getSubValue
 
def getCreateSubValue
 
def getClosestSubValue
 
def getSubValueList
 
def getSubValueIterList
 
def hasSubValue
 
def getType
 
def getDesc
 

Public Attributes

 instance
 
 function
 
 name
 
 project
 
 runSeqNr
 
 cputime
 
 runLock
 
 activeNetwork
 
 inputVal
 
 outputVal
 
 subnetInputVal
 
 subnetOutputVal
 
 stagedInputVal
 
 stagedSubnetInputVal
 
 inputAcps
 
 outputAcps
 
 subnetInputAcps
 
 subnetOutputAcps
 
 baseDir
 
 persDir
 
 msg
 
 outputDirNr
 
 genTasks
 
 updated
 
 inputLock
 
 outputLock
 
 lock
 
 state
 
 tasks
 
 subnet
 
 inputListeners
 
 lastUpdateAI
 
 lastUpdateSeqNr
 
 lastUpdateSource
 

Static Public Attributes

tuple held = ActiveInstanceState("held")
 
tuple active = ActiveInstanceState("active")
 
tuple warning = ActiveInstanceState("warning")
 
tuple blocked = ActiveInstanceState("blocked")
 
tuple error = ActiveInstanceState("error")
 
list states = [ held, active, warning, blocked, error ]
 

Detailed Description

An active instance is the instance and the data associated with running
   that instance. An active instance can have a subnetwork that is itself an
   active network. 
   
   It is itself not an instance object because there can be many active 
   realizations of instances (i.e. multiple instances of the same network 
   being active at the same time causes those instances to exist multiple
   times).

Member Function Documentation

def cpc.dataflow.active_inst.ActiveInstance.activate (   self)
Set the state of this active instance to active, if held.
def cpc.dataflow.active_inst.ActiveInstance.addCputime (   self,
  cputime 
)
add used cpu time to this active instance.
def cpc.dataflow.active_inst.ActiveInstance.addTask (   self,
  tsk 
)
Append an existing task to the task list. Useful for reading in
def cpc.dataflow.active_inst.ActiveInstance.cancelTasks (   self,
  seqNr 
)
Cancel all tasks (and commands) with sequence number before 
   the given seqNr. 
   Returns a list of cancelled commands.
def cpc.dataflow.active_inst.ActiveInstance.deactivate (   self)
Set the state of this active instance to held, if active.
def cpc.dataflow.active_inst.ActiveInstance.findErrorStates (   self,
  errlist,
  warnlist 
)
Find any error & warning states associated with this ai or any
   of its sub-instances. Fills errlist and warnlist active instances
   in these states.
def cpc.dataflow.active_inst.ActiveInstance.getBasedir (   self)
Get the active instance's base directory relative to the project 
    dir.
def cpc.dataflow.active_inst.ActiveInstance.getCanonicalName (   self)
Get the canonical name for this active instance.
def cpc.dataflow.active_inst.ActiveInstance.getClosestSubValue (   self,
  itemList 
)
Get the closest relevant subvalue through a list of subitems, 
   
   itemList = the path of the value to get the closest value for 
def cpc.dataflow.active_inst.ActiveInstance.getCputime (   self)
def cpc.dataflow.active_inst.ActiveInstance.getCreateSubValue (   self,
  itemList,
  createType = None,
  setCreateSourceTag = None 
)
Get or create a specific subvalue through a list of subitems, or 
   return None if not found.
   itemList = the path of the value to return/create
   if createType == a type, a subitem will be created with the given 
            type
   if setCreateSourceTag = not None, the source tag will be set for
                   any items that are created.
def cpc.dataflow.active_inst.ActiveInstance.getCumulativeCputime (   self)
Get the total CPU time used by active instance and its 
    internal network.
def cpc.dataflow.active_inst.ActiveInstance.getDesc (   self)
Return a 'description' of a value: an item that can be passed to 
   the client describing the value.
def cpc.dataflow.active_inst.ActiveInstance.getFullBasedir (   self)
Get the active instance's absolute base directory.
def cpc.dataflow.active_inst.ActiveInstance.getFunction (   self)
Get the function associated with this a.i.
def cpc.dataflow.active_inst.ActiveInstance.getIncreasedSeqNr (   self)
def cpc.dataflow.active_inst.ActiveInstance.getInputACP (   self,
  itemList 
)
Get or make an active connection point in the input. 

   It is assumed project.networkLock is locked when using this 
   function.
def cpc.dataflow.active_inst.ActiveInstance.getInputs (   self)
Get the input value object.
def cpc.dataflow.active_inst.ActiveInstance.getLog (   self)
Get the log object associated with this active instance, or None
def cpc.dataflow.active_inst.ActiveInstance.getName (   self)
Get the local name of this active instance.
def cpc.dataflow.active_inst.ActiveInstance.getNamedType (   self,
  direction,
  itemList 
)
Get the type of a specific named value.
def cpc.dataflow.active_inst.ActiveInstance.getNet (   self)
Get the subnet network, or None if none exists. Is a constant
   property
def cpc.dataflow.active_inst.ActiveInstance.getOutputACP (   self,
  itemList 
)
Get or make an active connection point in the output. 

   It is assumed project.networkLock is locked when using this 
   function.
def cpc.dataflow.active_inst.ActiveInstance.getOutputs (   self)
Get the output value object.
def cpc.dataflow.active_inst.ActiveInstance.getPropagatedStateStr (   self)
Get the propagated state associated with this active instance:
   i.e. with any error conditions of sub-instances.
def cpc.dataflow.active_inst.ActiveInstance.getSeqNr (   self)
def cpc.dataflow.active_inst.ActiveInstance.getStagedInputs (   self)
Get the staged input value object.
def cpc.dataflow.active_inst.ActiveInstance.getStagedSubnetInputs (   self)
Get the staged subnet input value object.
def cpc.dataflow.active_inst.ActiveInstance.getState (   self)
Get the current state as an object 
def cpc.dataflow.active_inst.ActiveInstance.getStateStr (   self)
Get the current state as a string.
def cpc.dataflow.active_inst.ActiveInstance.getSubnetInputACP (   self,
  itemList 
)
Get or make an active connection point in the subnet input. 

   It is assumed project.networkLock is locked when using this 
   function.
def cpc.dataflow.active_inst.ActiveInstance.getSubnetInputs (   self)
Get the subnet input value object.
def cpc.dataflow.active_inst.ActiveInstance.getSubnetOutputACP (   self,
  itemList 
)
Get or make an active connection point in the subnet output. 

   It is assumed project.networkLock is locked when using this 
   function.
def cpc.dataflow.active_inst.ActiveInstance.getSubnetOutputs (   self)
Get the subnet output value object.
def cpc.dataflow.active_inst.ActiveInstance.getSubValue (   self,
  itemList 
)
Get a specific subvalue through a list of subitems, or return None 
   if not found.
   itemList = the path of the value to return
def cpc.dataflow.active_inst.ActiveInstance.getSubValueIterList (   self)
Return an iterable list of addressable subvalues.
def cpc.dataflow.active_inst.ActiveInstance.getSubValueList (   self)
Return a list of addressable subvalues.
def cpc.dataflow.active_inst.ActiveInstance.getTasks (   self)
Get the task list 
def cpc.dataflow.active_inst.ActiveInstance.getType (   self)
Return the type associated with this value
def cpc.dataflow.active_inst.ActiveInstance.getValueAffectedAIs (   self,
  closestVal,
  affectedInputAIs 
)
Get the affected input ais for setting a new value.
def cpc.dataflow.active_inst.ActiveInstance.handleNewConnections (   self)
Process a new output connection. 
   
   NOTE: This function assumes that self.outputLock is locked and
 that there is some global lock preventing concurrent updates, 
 and that it is locked. This normally is project.networkLock.
def cpc.dataflow.active_inst.ActiveInstance.handleNewInput (   self,
  sourceTag,
  seqNr,
  noNewTasks = False 
)
Process new input based on the changing of values.
   
   sourceTag =  the source to look for 

   if source is None, all the active connections that have 
   newSetValue set are updated. The seqNr is then ignored.

   if noNewTasks == true, no new tasks will be generated

   NOTE: If sourceAI is None, this function assumes that there is 
 some global lock preventing concurrent updates, and 
 that it is locked. This normally is project.networkLock.
def cpc.dataflow.active_inst.ActiveInstance.handleTaskOutput (   self,
  sourceTag,
  seqNr,
  output,
  subnetOutput,
  warnMsg 
)
Handle the output of a finished task that is generated from 
   this active instance.

   NOTE: assumes that the ai is locked with self.outputLock!!!
def cpc.dataflow.active_inst.ActiveInstance.hasSubValue (   self,
  itemList 
)
Check whether a particular subvalue exists
def cpc.dataflow.active_inst.ActiveInstance.markError (   self,
  msg,
  reportAsNew = True 
)
Mark active instance as being in error state.

   If reportAsNew is True, the error will be reported as new, otherwise
   it is an existing error that is being re-read
def cpc.dataflow.active_inst.ActiveInstance.removeTask (   self,
  task 
)
Remove a task from the list
def cpc.dataflow.active_inst.ActiveInstance.rerun (   self,
  recursive,
  clearError,
  outf = None 
)
Force the rerun of this instance, or clear the error if in error
   state and clearError is True. If recursive is set, 
   do the same for any subinstances. 
   Returns the number of reruns forced
def cpc.dataflow.active_inst.ActiveInstance.resetUpdated (   self)
def cpc.dataflow.active_inst.ActiveInstance.setCputime (   self,
  cputime 
)
set used cpu time to this active instance.
def cpc.dataflow.active_inst.ActiveInstance.setSeqNr (   self,
  seqNr 
)
Set the sequence number
def cpc.dataflow.active_inst.ActiveInstance.setState (   self,
  state 
)
Set the state without side effects
def cpc.dataflow.active_inst.ActiveInstance.setWarning (   self,
  msg 
)
Set warning message.
def cpc.dataflow.active_inst.ActiveInstance.stageNamedInput (   self,
  val,
  newVal,
  sourceTag 
)
Stage a new value to the list of new input values. handleNewInput()
   will pick up these inputs if sourceAI == None.

   This function assumes that there is some kind of lock between
   setNamedInput() and handleNewInput() so that no network-wide update 
   from another source can take place in the mean time. 
   Normally, this is project.networkLock
def cpc.dataflow.active_inst.ActiveInstance.unblock (   self)
Unblock a task, forcing it to run
def cpc.dataflow.active_inst.ActiveInstance.writeDebug (   self,
  outf 
)
def cpc.dataflow.active_inst.ActiveInstance.writeXML (   self,
  outf,
  indent = 0 
)
write out values as xml.

Member Data Documentation

tuple cpc.dataflow.active_inst.ActiveInstance.active = ActiveInstanceState("active")
static
cpc.dataflow.active_inst.ActiveInstance.activeNetwork
cpc.dataflow.active_inst.ActiveInstance.baseDir
tuple cpc.dataflow.active_inst.ActiveInstance.blocked = ActiveInstanceState("blocked")
static
cpc.dataflow.active_inst.ActiveInstance.cputime
tuple cpc.dataflow.active_inst.ActiveInstance.error = ActiveInstanceState("error")
static
cpc.dataflow.active_inst.ActiveInstance.function
cpc.dataflow.active_inst.ActiveInstance.genTasks
tuple cpc.dataflow.active_inst.ActiveInstance.held = ActiveInstanceState("held")
static
cpc.dataflow.active_inst.ActiveInstance.inputAcps
cpc.dataflow.active_inst.ActiveInstance.inputListeners
cpc.dataflow.active_inst.ActiveInstance.inputLock
cpc.dataflow.active_inst.ActiveInstance.inputVal
cpc.dataflow.active_inst.ActiveInstance.instance
cpc.dataflow.active_inst.ActiveInstance.lastUpdateAI
cpc.dataflow.active_inst.ActiveInstance.lastUpdateSeqNr
cpc.dataflow.active_inst.ActiveInstance.lastUpdateSource
cpc.dataflow.active_inst.ActiveInstance.lock
cpc.dataflow.active_inst.ActiveInstance.msg
cpc.dataflow.active_inst.ActiveInstance.name
cpc.dataflow.active_inst.ActiveInstance.outputAcps
cpc.dataflow.active_inst.ActiveInstance.outputDirNr
cpc.dataflow.active_inst.ActiveInstance.outputLock
cpc.dataflow.active_inst.ActiveInstance.outputVal
cpc.dataflow.active_inst.ActiveInstance.persDir
cpc.dataflow.active_inst.ActiveInstance.project
cpc.dataflow.active_inst.ActiveInstance.runLock
cpc.dataflow.active_inst.ActiveInstance.runSeqNr
cpc.dataflow.active_inst.ActiveInstance.stagedInputVal
cpc.dataflow.active_inst.ActiveInstance.stagedSubnetInputVal
cpc.dataflow.active_inst.ActiveInstance.state
list cpc.dataflow.active_inst.ActiveInstance.states = [ held, active, warning, blocked, error ]
static
cpc.dataflow.active_inst.ActiveInstance.subnet
cpc.dataflow.active_inst.ActiveInstance.subnetInputAcps
cpc.dataflow.active_inst.ActiveInstance.subnetInputVal
cpc.dataflow.active_inst.ActiveInstance.subnetOutputAcps
cpc.dataflow.active_inst.ActiveInstance.subnetOutputVal
cpc.dataflow.active_inst.ActiveInstance.tasks
cpc.dataflow.active_inst.ActiveInstance.updated
tuple cpc.dataflow.active_inst.ActiveInstance.warning = ActiveInstanceState("warning")
static

The documentation for this class was generated from the following file: