Search in sources :

Example 21 with VariableGroup

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.

the class Validator method addCharge.

private void addCharge(ModelDescription modelDescription, Map<Object, Object> map, ChargeType element) {
    VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
    if (variableGroup != null) {
        map.put(variableGroup, element);
        addVariables(modelDescription, map, element.getVariable());
    }
}
Also used : VariableGroup(com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup)

Example 22 with VariableGroup

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.

the class Validator method addAngularMechanicalPort.

private void addAngularMechanicalPort(ModelDescription modelDescription, Map<Object, Object> map, AngularMechanicalPortType element) {
    VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
    if (variableGroup != null) {
        map.put(variableGroup, element);
        addTorque(modelDescription, map, element.getTorque());
        addAngularVelocity(modelDescription, map, element.getAngularVelocity());
    }
}
Also used : VariableGroup(com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup)

Example 23 with VariableGroup

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.

the class Validator method addPressure.

private void addPressure(ModelDescription modelDescription, Map<Object, Object> map, PressureType element) {
    VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
    if (variableGroup != null) {
        map.put(variableGroup, element);
        addVariables(modelDescription, map, element.getVariable());
    }
}
Also used : VariableGroup(com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup)

Example 24 with VariableGroup

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.

the class Validator method addVolume.

private void addVolume(ModelDescription modelDescription, Map<Object, Object> map, VolumeType element) {
    VariableGroup variableGroup = ModelDescriptionUtil.getVariableGroupByName(modelDescription, element.getName());
    if (variableGroup != null) {
        map.put(variableGroup, element);
        addVariables(modelDescription, map, element.getVariable());
    }
}
Also used : VariableGroup(com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup)

Example 25 with VariableGroup

use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.

the class SystemStructureFactoryTest method canCreate.

@Test
public void canCreate() {
    SystemStructureFactory factory = new SystemStructureFactory();
    SystemStructure systemStructure = factory.create(TestResources.OSP_SYSTEM_STRUCTURE_CRANE);
    List<Simulator> simulators = systemStructure.getSimulators();
    List<VariableConnection> variableConnections = systemStructure.getVariableConnections();
    List<VariableGroupConnection> variableGroupConnections = systemStructure.getVariableGroupConnections();
    assertEquals(2, simulators.size());
    Simulator s1 = simulators.get(0);
    assertEquals("crane_controller", s1.getName().get());
    Simulator s2 = simulators.get(1);
    assertEquals("knuckle_boom_crane", s2.getName().get());
    assertEquals(1, variableConnections.size());
    VariableConnection variableConnection = variableConnections.get(0);
    Simulator simulatorA = variableConnection.getSimulatorA();
    Variable variableA = variableConnection.getVariableA();
    Simulator simulatorB = variableConnection.getSimulatorB();
    Variable variableB = variableConnection.getVariableB();
    assertEquals("crane_controller", simulatorA.getName().get());
    assertEquals("Act_Limits[1]", variableA.getName().get());
    assertEquals("knuckle_boom_crane", simulatorB.getName().get());
    assertEquals("Act_Limits[1]", variableB.getName().get());
    assertEquals(1, variableGroupConnections.size());
    VariableGroupConnection variableGroupConnection = variableGroupConnections.get(0);
    Simulator simulatorA1 = variableGroupConnection.getSimulatorA();
    VariableGroup variableGroupA = variableGroupConnection.getVariableGroupA();
    Simulator simulatorB1 = variableGroupConnection.getSimulatorB();
    VariableGroup variableGroupB = variableGroupConnection.getVariableGroupB();
    assertEquals("crane_controller", simulatorA1.getName().get());
    assertEquals("linear_mechanical_port", variableGroupA.getName().get());
    assertEquals("knuckle_boom_crane", simulatorB1.getName().get());
    assertEquals("linear_mechanical_port", variableGroupB.getName().get());
}
Also used : Variable(com.opensimulationplatform.core.model.modeldescription.Variable) SystemStructure(com.opensimulationplatform.core.model.systemstructure.SystemStructure) VariableGroupConnection(com.opensimulationplatform.core.model.systemstructure.VariableGroupConnection) VariableGroup(com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup) VariableConnection(com.opensimulationplatform.core.model.systemstructure.VariableConnection) Simulator(com.opensimulationplatform.core.model.systemstructure.Simulator) Test(org.junit.Test)

Aggregations

VariableGroup (com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup)34 OWLNamedIndividual (org.semanticweb.owlapi.model.OWLNamedIndividual)6 VariableGroupConnection (com.opensimulationplatform.core.model.systemstructure.VariableGroupConnection)5 Test (org.junit.Test)5 Simulator (com.opensimulationplatform.core.model.systemstructure.Simulator)4 ValidationDiagnostic (com.opensimulationplatform.core.validation.ValidationDiagnostic)4 Variable (com.opensimulationplatform.core.model.modeldescription.Variable)3 Generic (com.opensimulationplatform.core.model.modeldescription.variablegroup.generic.Generic)3 ValidationError (com.opensimulationplatform.core.validation.ValidationError)3 List (java.util.List)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 OWLAxiom (org.semanticweb.owlapi.model.OWLAxiom)3 OWLClass (org.semanticweb.owlapi.model.OWLClass)3 OWLObjectProperty (org.semanticweb.owlapi.model.OWLObjectProperty)3 Force (com.opensimulationplatform.core.model.modeldescription.variablegroup.force.Force)1 SystemStructure (com.opensimulationplatform.core.model.systemstructure.SystemStructure)1 VariableConnection (com.opensimulationplatform.core.model.systemstructure.VariableConnection)1 VE_VariableGroup_1 (com.opensimulationplatform.gen.owl.model.OntologyClasses.VE_VariableGroup_1)1 VE_VariableGroup_2 (com.opensimulationplatform.gen.owl.model.OntologyClasses.VE_VariableGroup_2)1