use of edu.uah.rsesc.aadlsimulator.agree.engine.AGREESimulationState in project AGREE by loonwerks.
the class CounterexampleLoaderHelper method buildAgreeNameToSimulationStateElementMap.
private Map<String, Object> buildAgreeNameToSimulationStateElementMap(final AGREESimulationEngine simEngine) {
final AGREESimulationState simState = simEngine.getCurrentState();
final Map<String, Object> result = new HashMap<String, Object>();
for (Object element : simState.getRootElements()) {
populateAgreeNameToSimulationStateElementMap(result, simState, element);
}
return result;
}
use of edu.uah.rsesc.aadlsimulator.agree.engine.AGREESimulationState in project AGREE by loonwerks.
the class ExportAction method buildExportArguments.
private ExportArguments buildExportArguments() {
final SimulationUIService simUiService = (SimulationUIService) Objects.requireNonNull(PlatformUI.getWorkbench().getService(SimulationUIService.class), "Unable to retrieve Simulation UI Service");
final SimulatorState simulatorState = simUiService.getCurrentState();
if (!(simulatorState.getEngineState() instanceof AGREESimulationState)) {
throw new RuntimeException("Simulation engine state must be an AGREESimulationState");
}
if (!(simulatorState.getSimulationEngine() instanceof AGREESimulationEngine)) {
throw new RuntimeException("Simulation engine must be an AGREESimulationEngine");
}
final AGREESimulationState agreeSimState = (AGREESimulationState) simulatorState.getEngineState();
final AGREESimulationEngine engine = (AGREESimulationEngine) simulatorState.getSimulationEngine();
final ComponentImplementation componentImplementation = engine.getSystemInstance().getComponentImplementation();
final Counterexample cex = buildCounterexample(agreeSimState);
final Renaming renaming = engine.getSimulationProgram().getAgreeRenaming();
return new ExportArguments() {
@Override
public ComponentImplementation getComponentImplementation() {
return componentImplementation;
}
@Override
public Counterexample getCounterexample() {
return cex;
}
@Override
public Renaming getAgreeRenaming() {
return renaming;
}
};
}
Aggregations