use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addHydraulicPort.
private void addHydraulicPort(ModelDescription modelDescription, Map<Object, Object> map, HydraulicPortType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addPressure(modelDescription, map, element.getPressure());
addVolumeFlowRate(modelDescription, map, element.getVolumeFlowRate());
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addGeneric.
private void addGeneric(ModelDescription modelDescription, Map<Object, Object> map, GenericType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
element.getGeneric().forEach(vg -> addGeneric(modelDescription, map, vg));
element.getAngularDisplacement().forEach(vg -> addAngularDisplacement(modelDescription, map, vg));
element.getAngularMechanicalPort().forEach(vg -> addAngularMechanicalPort(modelDescription, map, vg));
element.getAngularMechanicalQuasiPort().forEach(vg -> addAngularMechanicalQuasiPort(modelDescription, map, vg));
element.getAngularVelocity().forEach(vg -> addAngularVelocity(modelDescription, map, vg));
element.getCharge().forEach(vg -> addCharge(modelDescription, map, vg));
element.getCurrent().forEach(vg -> addCurrent(modelDescription, map, vg));
element.getElectromagneticPort().forEach(vg -> addElectromagneticPort(modelDescription, map, vg));
element.getElectromagneticQuasiPort().forEach(vg -> addElectromagneticQuasiPort(modelDescription, map, vg));
element.getForce().forEach(vg -> addForce(modelDescription, map, vg));
element.getHydraulicPort().forEach(vg -> addHydraulicPort(modelDescription, map, vg));
element.getHydraulicQuasiPort().forEach(vg -> addHydraulicQuasiPort(modelDescription, map, vg));
element.getLinearDisplacement().forEach(vg -> addLinearDisplacement(modelDescription, map, vg));
element.getLinearMechanicalPort().forEach(vg -> addLinearMechanicalPort(modelDescription, map, vg));
element.getLinearMechanicalQuasiPort().forEach(vg -> addLinearMechanicalQuasiPort(modelDescription, map, vg));
element.getLinearVelocity().forEach(vg -> addLinearVelocity(modelDescription, map, vg));
element.getPressure().forEach(vg -> addPressure(modelDescription, map, vg));
element.getTorque().forEach(vg -> addTorque(modelDescription, map, vg));
element.getVoltage().forEach(vg -> addVoltage(modelDescription, map, vg));
element.getVolume().forEach(vg -> addVolume(modelDescription, map, vg));
element.getVolumeFlowRate().forEach(vg -> addVolumeFlowRate(modelDescription, map, vg));
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VariableGroupOwlBuilder method setVariableGroups.
private void setVariableGroups(VariableGroup variableGroup, OWLNamedIndividual variableGroupIndividual) {
OWLObjectProperty hasVariableGroup = context.owl.dataFactory.getOWLObjectProperty(op_has_variable_group, context.owl.prefixManager);
List<VariableGroup> variableGroups = variableGroup.getVariableGroups();
for (VariableGroup vg : variableGroups) {
vg.getName().setId(() -> variableGroup.getName().getId().get().replace("." + variableGroup.getName().get(), ".") + vg.getName().get());
OWLNamedIndividual vgIndividual = this.build(vg);
OWLAxiom axiom = context.owl.dataFactory.getOWLObjectPropertyAssertionAxiom(hasVariableGroup, variableGroupIndividual, vgIndividual);
context.axioms.add(axiom);
}
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class SystemStructureUtil method getVariableGroupConnectionByPartNames.
public static Optional<VariableGroupConnection> getVariableGroupConnectionByPartNames(SystemStructure systemStructure, String simulatorAName, String variableGroupAName, String simulatorBName, String variableGroupBName) {
List<VariableGroupConnection> variableGroupConnections = systemStructure.getVariableGroupConnections();
for (VariableGroupConnection variableGroupConnection : variableGroupConnections) {
Simulator simulatorA = variableGroupConnection.getSimulatorA();
VariableGroup variableA = variableGroupConnection.getVariableGroupA();
Simulator simulatorB = variableGroupConnection.getSimulatorB();
VariableGroup variableB = variableGroupConnection.getVariableGroupB();
if (simulatorAName.equals(simulatorA.getName().get()) && variableGroupAName.equals(variableA.getName().get()) && simulatorBName.equals(simulatorB.getName().get()) && variableGroupBName.equals(variableB.getName().get())) {
return Optional.of(variableGroupConnection);
}
}
return Optional.empty();
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class Validator method addVolumeFlowRate.
private void addVolumeFlowRate(ModelDescription modelDescription, Map<Object, Object> map, VolumeFlowRateType element) {
VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
if (variableGroup != null) {
map.put(variableGroup, element);
addVariables(modelDescription, map, element.getVariable());
}
}
Aggregations