This repository is based on the previous PCM-Docker project (PCM-Docker Repository) and is in all aspects superior compared to the "old" implementation. Therefore you should avoid using the PCM-Docker repository if possible.
This implementation provides fully headless simulations of PCM (Palladio Component Model) instances. You can either use the code directly in your project as dependency (the harder way), or setup the provided Docker image and easily use the exposed REST interface.
Supported simulation engines:
- SimuCom
- SimuLizar
- EventSim (not planned but maybe some future stuff)
If you want to know more about how the headless simulations work you can click here.
In general, there are two different ways to use the headless implementation. The first and simpler method is the use of the prepared Docker Image in combination with the offered REST interface. The second possibility is the direct use of the Gradle projects and the source code.
Or the easy way, just use Docker and execute: docker run --name pcm-docker -p 8080:8080 davmonsch/pcm-headless-rest
After that you are ready to go.
The usage is very intuitive and in general looks like this:
PCMHeadlessClient client = new PCMHeadlessClient("http://127.0.0.1:8080/");
if (client.isReachable(3000)) {
// new client for a new simulation
SimulationClient sim = client.prepareSimulation();
sim.setAllocation(allocationFile);
sim.setRepository(repositoryFile);
sim.setSystem(systemFile);
sim.setUsageModel(usageFile);
sim.setResourceEnvironment(resourceEnvironmentFile);
sim.setMonitorRepository(monitorRepositoryFile);
// set default config
sim.setSimulationConfig(HeadlessSimulationConfig.builder().build());
// transitive closure of models & transfer to REST
sim.createTransitiveClosure();
sim.sync();
// simulate and use results
sim.executeSimulation(res -> {
// do something with the results
});
}
More examples and explanations can be found under Usage.
The Spring-Boot application that provides the REST interface also offers a very simple Web UI. With the help of this UI it is possible to view the status of the current simulations. Furthermore it offers the possibility to trigger simulations manually.
The current limitations, problems and future improvements are documented here.
Look into the Wiki and see if it addresses your question(s) or feel free to open an issue.
This repository is based on many other projects. The most important of them are:
- Palladio Component Model and several related projects
- Eclipse Modeling Framework (EMF)
- Docker
- Spring Boot
- Lombok