Package jline.lang.lal
Class Composition
java.lang.Object
jline.lang.lal.Composition
A collection of agents with atomic synchronizations (Python
builder.Composition). Its parts are hand-declared Agents and
embedded LINE models (a Network, Environment,
LayeredNetwork, MarkovProcess, MarkovChain or
Workflow), mixed freely; an embedded model contributes one agent per
node, whose actions are named by action(java.lang.Object, jline.lang.constant.EventType). Agent changes are
reflected on the next call to getStruct(); no derived matrices are
cached, and refresh() re-reads embedded models after they change.-
Constructor Summary
ConstructorsConstructorDescriptionComposition(Object... parts) Composition of mixed parts:Agents and LINE model objects, each of the latter embedded as byadd(Object).Composition(String name, List<Agent> agents) Composition(String name, Agent... agents) Named composition; the name is that of the owned LINEnetwork.Composition(List<Agent> agents) Composition(Agent... agents) Composition namedLAL. -
Method Summary
Modifier and TypeMethodDescriptionaction(Object, EventType, Object, String, String)matching every class.action(Object, EventType, Object, String, String)for one class (object or name).Return a reference to a node action of an embedded LINE model.add(Object, String, Integer)with no prefix and no cutoff.Embed a LINE model; each of its nodes becomes an agent of the composition.static CompositionLoad a LAL declaration from a UTF-8 text file.static CompositionfromString(String source) Parse a LAL declaration into a programmatic composition.The embedded LINE models, by part name.Node-key synchronizations with hand passives.Loweredagent.actionto node-event label map, empty when not lowered.The composition this one was lowered from, ornull.getModel()Immutable model snapshot of the current parts and synchronizations (Python_model).The LINE network owned by the composition (named after it).List<?>Return finite CTMC states, generator and labelled event matrices.getSyncs()Make actions internal: they still occur, but leave the action tables.booleanTrue when SolverMAM lowered this composition from embedded LINE networks.refresh()Re-read every embedded LINE model after it was changed.setReward(String name, ToDoubleFunction<StateView> fn) Declare a state rewardfn(view), read back with the solvers'getAvgReward().voidRecord the filter order of a flattened LINE CTMC (Pythonsource_event_orderattribute).voidRecord the state space of a flattened LINE CTMC (Pythonsource_state_spaceattribute).voidsetSourceSync(List<?> v) Record the LINE synchronisations aligned with the filters (Pythonsource_syncattribute).voidMark the composition as a truncated source (Pythonsource_truncatedattribute).synchronize(Object active, Object... passives) Synchronize one active action with one or more passive ones:synchronize(agent.action(a), other.action(p), ...): hand agents;synchronize(agent.action(a), comp.action(node, EventType.ARV, cls)): the hand action injects an arrival of an open class at the node;synchronize(comp.action(node, event, cls), agent.action(p), ...): the hand passives join every network event carrying that node key, and block it while they are disabled.synchronize(ActionRef active, ActionRef... passives) Synchronize one active action with one or more passive actions of hand agents.synchronizeMin(List<ActionRef> actives, List<ActionRef> passives) Synchronize active actions at the minimum enabled total rate.synchronizeMin(ActionRef... actives) Minimum synchronization of two or more active actions with no passive partners.
-
Constructor Details
-
Composition
Composition namedLAL. Agents are optional here; a composition with no part is refused when its model is compiled. -
Composition
-
Composition
Named composition; the name is that of the owned LINEnetwork. -
Composition
-
Composition
Composition of mixed parts:Agents and LINE model objects, each of the latter embedded as byadd(Object). A leading string names the composition.
-
-
Method Details
-
getAgents
-
getNetwork
The LINE network owned by the composition (named after it). -
getEmbedded
The embedded LINE models, by part name. -
add
add(Object, String, Integer)with no prefix and no cutoff. -
add
Embed a LINE model; each of its nodes becomes an agent of the composition.modelis aNetwork,MarkovProcess,MarkovChain,Workflow,EnvironmentorLayeredNetwork, a LALAgent, or another composition (nested). Node actions are then named byaction(java.lang.Object, jline.lang.constant.EventType).prefixnames the embedded part (required when two parts would share node names);cutoffbounds open classes as in SolverCTMC. The model must be Markovian (LINE:unsupported:NonMarkovianotherwise).- Parameters:
prefix- part name, ornullcutoff- open-class cutoff, ornull
-
hide
-
setReward
Declare a state rewardfn(view), read back with the solvers'getAvgReward().view.get(agent)is an agent's local state;view.node(part, node)is the state row of a node of an embedded model. -
refresh
Re-read every embedded LINE model after it was changed. -
action
action(Object, EventType, Object, String, String)matching every class. -
action
action(Object, EventType, Object, String, String)for one class (object or name). -
action
Return a reference to a node action of an embedded LINE model.- Parameters:
node- the LINE node object or its nameevent- the event type (ARV,DEP,PHASE,READ,ENABLE,FIRE,PRE,POST,RENEGE,RETRY,SWITCH,FAILURE,REPAIR,STAGE)jobclass- a class object or name, ornullto match every classmode- a Petri-net mode name forENABLE/FIRE, ornullpart- the embedded part name, required when several models are embedded
-
getSyncs
-
getMinSyncs
-
getExtSyncs
Node-key synchronizations with hand passives. -
synchronize
Synchronize one active action with one or more passive actions of hand agents. -
synchronize
Synchronize one active action with one or more passive ones:synchronize(agent.action(a), other.action(p), ...): hand agents;synchronize(agent.action(a), comp.action(node, EventType.ARV, cls)): the hand action injects an arrival of an open class at the node;synchronize(comp.action(node, event, cls), agent.action(p), ...): the hand passives join every network event carrying that node key, and block it while they are disabled.
-
synchronizeMin
Minimum synchronization of two or more active actions with no passive partners. -
synchronizeMin
Synchronize active actions at the minimum enabled total rate. Each participant's enabled transition is sampled proportionally to its local rate or passive weight; any disabled participant blocks the event. The first active action names the event. Node actions of embedded models are refused: a minimum would retime LINE's own event. -
getModel
Immutable model snapshot of the current parts and synchronizations (Python_model). -
getStruct
Return finite CTMC states, generator and labelled event matrices. -
fromString
Parse a LAL declaration into a programmatic composition. -
fromFile
Load a LAL declaration from a UTF-8 text file.- Throws:
IOException
-
getSourceStateSpace
-
getSourceEventOrder
-
getSourceSync
-
getSourceTruncated
-
setSourceTruncated
Mark the composition as a truncated source (Pythonsource_truncatedattribute). -
setSourceStateSpace
Record the state space of a flattened LINE CTMC (Pythonsource_state_spaceattribute). -
setSourceEventOrder
Record the filter order of a flattened LINE CTMC (Pythonsource_event_orderattribute). -
setSourceSync
Record the LINE synchronisations aligned with the filters (Pythonsource_syncattribute). -
isLowered
public boolean isLowered()True when SolverMAM lowered this composition from embedded LINE networks. -
getLoweredLabels
Loweredagent.actionto node-event label map, empty when not lowered. -
getLoweredSource
The composition this one was lowered from, ornull.
-