Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder Class Reference

builds a simulation model of an aXLang-model More...

List of all members.

Public Member Functions

void addSimulationEventListener (ISimulationEventListener eventListener)
 adds a simulation event listener
void buildSimulationModel ()
 builds the simulation model elements
Collection< SimulationClockPortgetClockPorts ()
 getter method for the collection of clock ports
Collection< SimulationServicegetInitialServices ()
 getter method for the collection of initial simulation services
Map< String, SimulationPortgetSimulationPortMap ()
 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< SimulationPortgetSimulationPorts ()
 getter method for the simulation ports
Collection< SimulationServicegetSimulationServices ()
 getter method for the collection of simulation services
Collection< SimulationStoragegetSimulationStorages ()
 getter method for the simulation variables
Map< String, SimulationStoragegetSimulationVariableMap ()
 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< FeaturegetCoveringFeatures (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< SimulationServicebuildUpSimulationServices ()
 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< ISelectiongetFeatureInducedSelections (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< FeaturegetXorAncestors (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< SimulationClockPortclClockPorts
Collection
< AbstractConnectionInstance
clConnectionInstances = null
Collection< SimulationServiceclInitialServices
Collection< PortInstanceclPortInstances = null
Collection< FunctionInstanceclServiceInstances = null
Collection
< ISimulationEventListener
clSimulationEventListeners
Collection< SimulationServiceclSimulationServices
Collection< StorageInstanceclStorageInstances = null
File rootDirectory
Map< String, SimulationPortsimulationPortMap
Map< String, SimulationStoragesimulationStorageMap
ApplicationModel theApplicationModel

Static Private Attributes

static F2AMapping theF2AMapping

Detailed Description

builds a simulation model of an aXLang-model

Author:
mgrosse
ekleinod
Version:
0.9.0
Since:
0.7.2

Constructor & Destructor Documentation

de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.SimulationModelBuilder ( Model  model,
ApplicationModel  applicationModel,
F2AMapping  f2aMapping 
)

Constructor setting the operation parameters.

Operation parameters:

  • one aXLang element
  • number of simulation steps

Member Function Documentation

void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.addSimulationEventListener ( ISimulationEventListener  eventListener  ) 

adds a simulation event listener

Parameters:
eventListener the simulation event listener to be added
void de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.buildSimulationModel (  ) 

builds the simulation model elements

Parameters:
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

Todo:
check if fall-through at "STRING" is correct
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

Parameters:
directory the current directory
Returns:
true if the deletion was successful, else false
Collection<SimulationClockPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getClockPorts (  ) 

getter method for the collection of clock ports

Returns:
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.)

Parameters:
startSelection the selected element (= positive selection) whose induced selections are sought
Returns:
all positive and negative selections to a positive start selection that must be selected according to the feature-to-application-mapping 'theF2AMapping'
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getInitialServices (  ) 

getter method for the collection of initial simulation services

Returns:
the collection of initial simulation services
static Feature de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getMappingFeature ( IGlobalInstance  globalInstance  )  [static]

returns

Parameters:
startSelection 
Returns:
returns the feature that is mapped to the given global instance; null if no such feature exists
Parameters:
globalInstance the global instance the mapping feature is sought for
Returns:
the feature that is mapped to the given global instance; null if no such feature exists
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.

Parameters:
theInputParameters map of the input parameters (empty map or null allowed)
Returns:
map of the output parameters (empty map allowed) getter method for the simulationPortMap
Collection<SimulationPort> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationPorts (  ) 

getter method for the simulation ports

Returns:
the collection of simulation ports
Collection<SimulationService> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationServices (  ) 

getter method for the collection of simulation services

Returns:
the collection of simulation services
Collection<SimulationStorage> de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.getSimulationStorages (  ) 

getter method for the simulation variables

Returns:
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

Parameters:
feature the feature whose xor-ancestors are sought
Returns:
all xor-features among the ancestors of the given feature
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

Parameters:
newSelection 
oldFeatures 
Returns:
true if the new selection is consistent with the old features, else false
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.)

Parameters:
newFeature the new feature
oldFeatures the old features
Returns:
true if the new feature contradicts the old ones
boolean de.fraunhofer.isst.axbench.operations.simulator.SimulationModelBuilder.removeServiceScripts (  ) 

removes the service scripts that have been created together with the simulation services

Returns:
true if the removal was successful, else false

Member Data Documentation