public class CompositeOptimizer extends ReflectComposite
In the case that the objective function is only a function of x, the trigger input should be used to start a new optimization round.
The variable named "maxEvaluations" can be used to limit the number of evaluations. Specifically, the inside SDF model will be fired at most maxEvaluations times. There may be several reasons it is fired less than this number. The iteration may terminate due to any of the following reasons: (i) convergence criteria met (ii) user requests termination (iii) the roundoff errors become damaging, especially if the function is not smooth, and no optimal value can be found under given constraints (iv) maximum number of evaluations are reached.
This actor is properly viewed as a "higher-order component" in that its contained actor is a parameter that specifies how to operate on input arrays. It is inspired by the higher-order functions of functional languages, but unlike those, the contained actor need not be functional. That is, it can have state.
Current implementation uses Cobyla as the solver. Cobyla implements the trust-region-reflective algorithm and performs a type of gradient descent optimization, ideal for objective functions that are non-convex and/or with unknown gradient.
Modifier and Type | Class and Description |
---|---|
static class |
CompositeOptimizer.OptimizerComposite
This is a specialized composite actor for use in CompositeOptimizer.
|
class |
CompositeOptimizer.OptimizerDirector
This is a specialized director that fires the input SDF model
repeatedly for different values of the optimization variable.
|
ReflectComposite.ReflectCompositeContents
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
dimensionOfOptimizationSpace
The dimension of optimization space.
|
Parameter |
maxEvaluations
Maximum number of function evaluations per iteration.
|
Parameter |
mode
Optimization mode. ( min or max)
|
Parameter |
numberOfConstraints
Number of constraints checked at each evaluation.
|
TypedIOPort |
optimalValue
Optimal Value
|
Parameter |
reusePreviousResult
The expert parameter that decides whether to reuse previous result as the initial value.
|
Parameter |
rhoBeg
The expert parameter that denotes the beginning step-size.
|
Parameter |
rhoEnd
The expert parameter that denotes the final step-size.
|
Parameter |
timeHorizon
Time horizon over which f(x) is optimized.
|
TypedIOPort |
trigger
Trigger.
|
_inAddPort, _inRemoveEntity, _mirrorParameterPorts
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CompositeOptimizer(CompositeEntity container,
java.lang.String name)
Constructs a CompositeOptimizer object.
|
CompositeOptimizer(Workspace workspace)
Constructs a CompositeOptimizer object.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
java.lang.Object |
clone(Workspace workspace)
Clone the object into the specified workspace.
|
void |
wrapup()
If this actor is opaque, then invoke the wrapup() method of the local
director.
|
_addEntity, _addPort, _exportMoMLContents, _mirrorPort, _removeEntity, _removePort, newParameterPort, newPort
_addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newRelation, resolveTypes, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, preinitialize, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter rhoBeg
public Parameter rhoEnd
public Parameter reusePreviousResult
public Parameter maxEvaluations
public Parameter mode
public Parameter timeHorizon
public Parameter dimensionOfOptimizationSpace
public Parameter numberOfConstraints
public TypedIOPort optimalValue
public TypedIOPort trigger
public CompositeOptimizer(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- a Workspace objectIllegalActionException
- ...NameDuplicationException
- ...public CompositeOptimizer(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- a CompositeEntity objectname
- a String ...IllegalActionException
- ...NameDuplicationException
- ...public void attributeChanged(Attribute attribute) throws IllegalActionException
TypedCompositeActor
attributeChanged
in class TypedCompositeActor
attribute
- The attribute that changed.IllegalActionException
- Not thrown in this base class.
Derived classes can throw this exception if type change is not allowed.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
ReflectComposite
clone
in class ReflectComposite
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If any of the attributes
cannot be cloned.CompositeEntity.exportMoML(Writer, int, String)
public void wrapup() throws IllegalActionException
CompositeActor
wrapup
in interface Initializable
wrapup
in class CompositeActor
IllegalActionException
- If there is no director,
or if the director's wrapup() method throws it, or if this
actor is not opaque.