uk.ac.ucl.cs.uml.jmi.BehavioralElements.Actions.CollectionActions
Interface ReduceAction

All Superinterfaces:
Action, CollectionAction, Element, ExtObject, ModelElement, javax.jmi.reflect.RefBaseObject, javax.jmi.reflect.RefFeatured, javax.jmi.reflect.RefObject
All Known Implementing Classes:
ReduceAction_Impl

public interface ReduceAction
extends CollectionAction

The reduce action applies an associative binary subaction repeatedly to adjacent pairs of slices from the input collections, until the (intermediate working) collection is reduced to a single slice of scalar values, which together constitute the output values of the reduce action. The order in which the subaction is applied to pairs of values is indeterminate, and does not affect the ultimate result if the action is associative, unless the subactions are not isolated from each other, in which case the result is unpredictable. As an example, consider a collection comprising four integers in order: 2, 7, 5 and -3. The result of applying the reduce action to this collection with the binary associative subaction Addition is the scalar 9. This can be computed by any of the following orderings: ( ( (2+7) + 5) + -3) = 11; (2 + (7 + (5 + -3))) = 11; ((2 + 7) + (5 + -3)) = 11. When the subaction is symmetric, as with addition, the order of the elements in the collection is not important. However, some associative operations are not symmetric, such as matrix multiplication, so A × B is not the same as B × A. In these cases, the concept of adjacency of the elements and the order in which they appear is critical. The reduce action requires a subaction, which must be a binary associative operator. Each of the two inputs to the subaction is a slice from the input collections to the reduce action. For example, to sum all the balances for a customer’s account, the reduce action has a single input collection of account balances, and a single scalar output, the sum of those balances, which must necessarily be of the same type. Each of the two inputs to the subaction, Addition, takes "a slice from the input collections to the reduce action", which in this case is a single account balance on each input. The output is a tuple ith the same structure: a balance. When the reduce action has several input collections, then one slice across all collections will be one input to the subaction and another slice will constitute the other input. The reduce action executes the subaction one fewer time than the size of the input collections., because it operates on adjacent pairs of slices from the input collections. The output of the subaction conceptually replaces the two input slices in the collection of tuples, so the subaction can be applied repeatedly to pairs of slices until a single slice remains. Its value is place on the result output pins of the overall reduce action as scalars. In other words, the reduce action serves to reduce a collection of values to a single value by repeated application of a binary function. If the subaction accesses values from outside the reduce action, uch values will be the same for all the concurrent subaction executions during a single execution of the reduce action. No output pins of the subaction may be connected outside the reduce action. The isUnordered attribute states that the reduction can be applied to the slices in any order, even though the ordering of elements in each collection is still used to match corresponding elements into slices. This will be mathematically valid if the subaction is symmetric and the actions are isolated.


Method Summary
 List getArgument()
           
 boolean getIsUnordered()
           
 List getLeftSubinput()
           
 List getRightSubinput()
           
 List getSuboutput()
           
 void setIsUnordered(boolean isUnordered)
          Setter for atomic property isUnordered)
 
Methods inherited from interface uk.ac.ucl.cs.uml.jmi.BehavioralElements.Actions.CollectionActions.CollectionAction
getSubaction, setSubaction
 
Methods inherited from interface uk.ac.ucl.cs.uml.jmi.BehavioralElements.Actions.ActionFoundation.Action
getAntecedent, getAvailableInput, getAvailableOutput, getConsequent, getGroup, getInputPin, getIsReadOnly, getJumpHandler, getOutputPin, setGroup, setIsReadOnly
 
Methods inherited from interface uk.ac.ucl.cs.uml.jmi.Foundation.Core.ModelElement
getAsArgument, getBehavior, getClientDependency, getComment, getConstraint, getContainer, getDefaultElement, getIsSpecification, getName, getNamespace, getPackage, getPresentation, getReferenceTag, getSourceFlow, getStereotype, getSupplierDependency, getTaggedValue, getTargetFlow, getTemplate, getTemplateArgument, getTemplateParameter, getVisibility, setDefaultElement, setIsSpecification, setName, setNamespace, setTemplate, setVisibility
 
Methods inherited from interface uk.ac.ucl.cs.emofocl.jmi.reflect.extended.ExtObject
extAddObjectListener, extDeepCopy, extDeepCopy, extEquals, extRemoveObjectListener, extValueHash, extVisit
 
Methods inherited from interface javax.jmi.reflect.RefObject
refClass, refDelete, refImmediateComposite, refIsInstanceOf, refOutermostComposite
 
Methods inherited from interface javax.jmi.reflect.RefFeatured
refGetValue, refGetValue, refInvokeOperation, refInvokeOperation, refSetValue, refSetValue
 
Methods inherited from interface javax.jmi.reflect.RefBaseObject
equals, hashCode, refImmediatePackage, refMetaObject, refMofId, refOutermostPackage, refVerifyConstraints
 

Method Detail

getIsUnordered

boolean getIsUnordered()
                       throws javax.jmi.reflect.JmiException
Throws:
javax.jmi.reflect.JmiException

setIsUnordered

void setIsUnordered(boolean isUnordered)
                    throws javax.jmi.reflect.JmiException
Setter for atomic property isUnordered)

Throws:
javax.jmi.reflect.JmiException

getSuboutput

List getSuboutput()
                  throws javax.jmi.reflect.JmiException
Throws:
javax.jmi.reflect.JmiException

getArgument

List getArgument()
                 throws javax.jmi.reflect.JmiException
Throws:
javax.jmi.reflect.JmiException

getLeftSubinput

List getLeftSubinput()
                     throws javax.jmi.reflect.JmiException
Throws:
javax.jmi.reflect.JmiException

getRightSubinput

List getRightSubinput()
                      throws javax.jmi.reflect.JmiException
Throws:
javax.jmi.reflect.JmiException