builds a simulation model of an aXLang-model More...
Public Member Functions | |
void | addSimulationEventListener (ISimulationEventListener eventListener) |
adds a simulation event listener | |
void | buildSimulationModel () |
builds the simulation model elements | |
Collection< SimulationClockPort > | getClockPorts () |
getter method for the collection of clock ports | |
Collection< SimulationService > | getInitialServices () |
getter method for the collection of initial simulation services | |
Map< String, SimulationPort > | getSimulationPortMap () |
builds up a simulation model from an aXLang-model and the generated service code (in the class ServiceExecutor) and runs it. The ServiceExecutor must be generated before with the operation generateServiceCode(IAXLangElement model) in the class ServiceCodeGenerator. | |
Collection< SimulationPort > | getSimulationPorts () |
getter method for the simulation ports | |
Collection< SimulationService > | getSimulationServices () |
getter method for the collection of simulation services | |
Collection< SimulationStorage > | getSimulationStorages () |
getter method for the simulation variables | |
Map< String, SimulationStorage > | getSimulationVariableMap () |
getter method for the simulationVariableMap | |
boolean | removeServiceScripts () |
removes the service scripts that have been created together with the simulation services | |
SimulationModelBuilder (Model model, ApplicationModel applicationModel, F2AMapping f2aMapping) | |
Constructor setting the operation parameters. | |
Static Public Member Functions | |
static Collection< Feature > | getCoveringFeatures (Collection< ISelection > selections) |
static Feature | getMappingFeature (IGlobalInstance globalInstance) |
returns | |
static boolean | isConsistentFeatureExtension (ISelection newSelection, Collection< IFeatureIon > oldFeatureIons) |
checks whether the new selection is consistent with the old features 1. if the selection is positive it must not be associated to a feature that is excluded by some old feature 2. if the selection is negative, no old feature must point to it; and if an alternative feature points to it, there must be another alternative among the old features | |
Private Member Functions | |
void | buildUpSimulationConnections () |
builds the simulation connections | |
void | buildUpSimulationPorts () |
builds the simulation ports | |
Collection< SimulationService > | buildUpSimulationServices () |
builds the simulation services | |
void | buildUpSimulationStorages () |
builds the simulation variables | |
boolean | deleteDirectory (File directory) |
auxiliary method needed for the recursive deletion of the directory that contains the service scripts | |
void | initializeSimulationPorts () |
defines the synchronicity values of the data elements declared at the ports, ie. defines whether they are synchronous or asynchronous, and defines the parameter2index-maps of the operations | |
Static Private Member Functions | |
static Collection< ISelection > | getFeatureInducedSelections (ISelection startSelection) |
returns all positive and negative selections to a positive start selection that must be selected according to the feature-to-application-mapping 'theF2AMapping' | |
static Collection< Feature > | getXorAncestors (Feature feature) |
returns all xor-features among the ancestors of the given feature | |
static boolean | isInConflictWith (Feature newFeature, Collection< Feature > oldFeatures) |
indicates whether the new feature contradicts the old features | |
Private Attributes | |
Collection< SimulationClockPort > | clClockPorts |
Collection < AbstractConnectionInstance > | clConnectionInstances = null |
Collection< SimulationService > | clInitialServices |
Collection< PortInstance > | clPortInstances = null |
Collection< FunctionInstance > | clServiceInstances = null |
Collection < ISimulationEventListener > | clSimulationEventListeners |
Collection< SimulationService > | clSimulationServices |
Collection< StorageInstance > | clStorageInstances = null |
File | rootDirectory |
Map< String, SimulationPort > | simulationPortMap |
Map< String, SimulationStorage > | simulationStorageMap |
ApplicationModel | theApplicationModel |
Static Private Attributes | |
static F2AMapping | theF2AMapping |
builds a simulation model of an aXLang-model
de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.SimulationModelBuilder | ( | Model | model, | |
ApplicationModel | applicationModel, | |||
F2AMapping | f2aMapping | |||
) |
Constructor setting the operation parameters.
Operation parameters:
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.addSimulationEventListener | ( | ISimulationEventListener | eventListener | ) |
adds a simulation event listener
eventListener | the simulation event listener to be added |
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildSimulationModel | ( | ) |
builds the simulation model elements
model | the aXLang-model for which the simulation model is built | |
axlInstanceBuilder | the instance builder that has been used to build the aXLang-model instances |
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildUpSimulationConnections | ( | ) | [private] |
builds the simulation connections
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildUpSimulationPorts | ( | ) | [private] |
builds the simulation ports
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildUpSimulationServices | ( | ) | [private] |
builds the simulation services
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildUpSimulationStorages | ( | ) | [private] |
builds the simulation variables
boolean de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.deleteDirectory | ( | File | directory | ) | [private] |
auxiliary method needed for the recursive deletion of the directory that contains the service scripts
directory | the current directory |
Collection<SimulationClockPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getClockPorts | ( | ) |
getter method for the collection of clock ports
static Collection<Feature> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getCoveringFeatures | ( | Collection< ISelection > | selections | ) | [static] |
static Collection<ISelection> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getFeatureInducedSelections | ( | ISelection | startSelection | ) | [static, private] |
returns all positive and negative selections to a positive start selection that must be selected according to the feature-to-application-mapping 'theF2AMapping'
The method applies the following rules:
1. If a feature maps to the start selection, then all other elements the feature points to (is mapped to) are selected, too 2. If a feature maps to the start selection that is an alternative of an xor-feature, then all elements the other alternatives point to are deselected.
: Yet the method works correctly only under the assumption that for each element there is at most one feature that points to this element. (Otherwise or-combinations of features would have to be considered.)
startSelection | the selected element (= positive selection) whose induced selections are sought |
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getInitialServices | ( | ) |
getter method for the collection of initial simulation services
static Feature de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getMappingFeature | ( | IGlobalInstance | globalInstance | ) | [static] |
returns
startSelection |
globalInstance | the global instance the mapping feature is sought for |
Map<String,SimulationPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationPortMap | ( | ) |
builds up a simulation model from an aXLang-model and the generated service code (in the class ServiceExecutor) and runs it. The ServiceExecutor must be generated before with the operation generateServiceCode(IAXLangElement model) in the class ServiceCodeGenerator.
theInputParameters | map of the input parameters (empty map or null allowed) |
Collection<SimulationPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationPorts | ( | ) |
getter method for the simulation ports
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationServices | ( | ) |
getter method for the collection of simulation services
Collection<SimulationStorage> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationStorages | ( | ) |
getter method for the simulation variables
Map<String,SimulationStorage> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationVariableMap | ( | ) |
getter method for the simulationVariableMap
static Collection<Feature> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getXorAncestors | ( | Feature | feature | ) | [static, private] |
returns all xor-features among the ancestors of the given feature
feature | the feature whose xor-ancestors are sought |
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.initializeSimulationPorts | ( | ) | [private] |
defines the synchronicity values of the data elements declared at the ports, ie. defines whether they are synchronous or asynchronous, and defines the parameter2index-maps of the operations
static boolean de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.isConsistentFeatureExtension | ( | ISelection | newSelection, | |
Collection< IFeatureIon > | oldFeatureIons | |||
) | [static] |
checks whether the new selection is consistent with the old features 1. if the selection is positive it must not be associated to a feature that is excluded by some old feature 2. if the selection is negative, no old feature must point to it; and if an alternative feature points to it, there must be another alternative among the old features
newSelection | ||
oldFeatures |
static boolean de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.isInConflictWith | ( | Feature | newFeature, | |
Collection< Feature > | oldFeatures | |||
) | [static, private] |
indicates whether the new feature contradicts the old features
The only possible conflict (yet) is that the new feature belongs to a branch below an xor-feature 'xor-f' and at least one of the old features belongs to a branch below another alternative of 'xor-f' than the new feature. (That means: The new feature and one old feature have a common ancestor that is an xor-feature.)
newFeature | the new feature | |
oldFeatures | the old features |
boolean de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.removeServiceScripts | ( | ) |
removes the service scripts that have been created together with the simulation services
Collection<SimulationClockPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clClockPorts [private] |
Collection<AbstractConnectionInstance> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clConnectionInstances = null [private] |
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clInitialServices [private] |
Collection<PortInstance> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clPortInstances = null [private] |
Collection<FunctionInstance> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clServiceInstances = null [private] |
Collection<ISimulationEventListener> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clSimulationEventListeners [private] |
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clSimulationServices [private] |
Collection<StorageInstance> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.clStorageInstances = null [private] |
Map<String, SimulationPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.simulationPortMap [private] |
Map<String, SimulationStorage> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.simulationStorageMap [private] |
ApplicationModel de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.theApplicationModel [private] |