use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class SimulatorOwlBuilder method setVariableGroups.
private void setVariableGroups(Simulator simulator, OWLNamedIndividual simulatorIndividual) {
List<VariableGroup> variableGroups = simulator.getModelDescription().getVariableGroups();
VariableGroupOwlBuilder variableGroupOwlBuilder = new VariableGroupOwlBuilder();
variableGroupOwlBuilder.setContext(context);
variableGroups.forEach(variableGroup -> {
if ("".equals(simulator.getName().get())) {
variableGroup.getName().setId(() -> variableGroup.getName().get());
} else {
variableGroup.getName().setId(() -> simulator.getName().get() + "." + variableGroup.getName().get());
}
OWLNamedIndividual variableGroupIndividual = variableGroupOwlBuilder.build(variableGroup);
OWLObjectProperty hasVariableGroup = context.owl.dataFactory.getOWLObjectProperty(op_has_variable_group, context.owl.prefixManager);
OWLAxiom axiom = context.owl.dataFactory.getOWLObjectPropertyAssertionAxiom(hasVariableGroup, simulatorIndividual, variableGroupIndividual);
context.axioms.add(axiom);
});
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VariableGroupConnectionConverter method convert.
@Override
public VariableGroupConnection convert(Connections.VariableGroupConnection variableGroupConnectionElement) {
VariableGroupConnection variableGroupConnection = new VariableGroupConnection();
List<VariableEndpoint> variableEndpoints = variableGroupConnectionElement.getVariableGroup();
VariableEndpoint variableEndpointA = variableEndpoints.get(0);
VariableEndpoint variableEndpointB = variableEndpoints.get(1);
Simulator simulatorA = SystemStructureUtil.getSimulatorByName(context.systemStructure, variableEndpointA.getSimulator()).get();
VariableGroup variableGroupA = ModelDescriptionUtil.getVariableGroupByName(simulatorA.getModelDescription(), variableEndpointA.getName());
variableGroupConnection.setSimulatorA(simulatorA);
variableGroupConnection.setVariableGroupA(variableGroupA);
Simulator simulatorB = SystemStructureUtil.getSimulatorByName(context.systemStructure, variableEndpointB.getSimulator()).get();
VariableGroup variableGroupB = ModelDescriptionUtil.getVariableGroupByName(simulatorB.getModelDescription(), variableEndpointB.getName());
variableGroupConnection.setSimulatorB(simulatorB);
variableGroupConnection.setVariableGroupB(variableGroupB);
return variableGroupConnection;
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addLinearVelocity.
private void addLinearVelocity(ModelDescription modelDescription, Map<Object, Object> map, LinearVelocityType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addAngularDisplacement.
private void addAngularDisplacement(ModelDescription modelDescription, Map<Object, Object> map, AngularDisplacementType angularDisplacementElement) {
VariableGroup angularDisplacement = ModelDescriptionUtil.getVariableGroupByName(modelDescription, angularDisplacementElement.getName());
if (angularDisplacement != null) {
map.put(angularDisplacement, angularDisplacementElement);
addVariables(modelDescription, map, angularDisplacementElement.getVariable());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addHydraulicQuasiPort.
private void addHydraulicQuasiPort(ModelDescription modelDescription, Map<Object, Object> map, HydraulicQuasiPortType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addPressure(modelDescription, map, element.getPressure());
addVolume(modelDescription, map, element.getVolume());
}
}
Aggregations