diff --git a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/Model.kt b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/Model.kt index 93081543..67d835d8 100644 --- a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/Model.kt +++ b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/Model.kt @@ -30,9 +30,6 @@ import no.ntnu.ihb.fmi4j.modeldescription.ModelDescription import no.ntnu.ihb.fmi4j.modeldescription.ModelExchangeModelDescription import java.io.Closeable -typealias CosimulationModel = Model -typealias ModelExchangeModel = Model - interface Model : Closeable { val modelDescription: ModelDescription @@ -40,3 +37,19 @@ interface Model : Closeable { fun newInstance(): ModelInstance } + + +interface CoSimulationModel: Model { + + override val modelDescription: CoSimulationModelDescription + + override fun newInstance(): SlaveInstance + +} + +interface ModelExchangeModel: Model { + + override val modelDescription: ModelExchangeModelDescription + +} + diff --git a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/AbstractFmu.kt b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/AbstractFmu.kt index 21f2b6c4..ebb0378f 100644 --- a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/AbstractFmu.kt +++ b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/AbstractFmu.kt @@ -24,8 +24,7 @@ package no.ntnu.ihb.fmi4j.importer -import no.ntnu.ihb.fmi4j.CosimulationModel -import no.ntnu.ihb.fmi4j.Model +import no.ntnu.ihb.fmi4j.CoSimulationModel import no.ntnu.ihb.fmi4j.ModelExchangeModel import no.ntnu.ihb.fmi4j.modeldescription.ModelDescriptionParser import no.ntnu.ihb.fmi4j.modeldescription.ModelDescriptionProvider @@ -89,7 +88,7 @@ abstract class AbstractFmu internal constructor( } } - abstract fun asCoSimulationFmu(): CosimulationModel + abstract fun asCoSimulationFmu(): CoSimulationModel abstract fun asModelExchangeFmu(): ModelExchangeModel diff --git a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi1/CoSimulationFmu.kt b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi1/CoSimulationFmu.kt index 34f018fb..40575fff 100644 --- a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi1/CoSimulationFmu.kt +++ b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi1/CoSimulationFmu.kt @@ -24,9 +24,7 @@ package no.ntnu.ihb.fmi4j.importer.fmi1 -import no.ntnu.ihb.fmi4j.CosimulationModel -import no.ntnu.ihb.fmi4j.Model -import no.ntnu.ihb.fmi4j.SlaveInstance +import no.ntnu.ihb.fmi4j.CoSimulationModel import no.ntnu.ihb.fmi4j.importer.fmi1.jni.CoSimulationLibraryWrapper import no.ntnu.ihb.fmi4j.importer.fmi1.jni.Fmi1CoSimulationLibrary import no.ntnu.ihb.fmi4j.modeldescription.CoSimulationModelDescription @@ -36,7 +34,7 @@ import java.io.Closeable class CoSimulationFmu( private val fmu: Fmu -) : CosimulationModel, Closeable by fmu { +) : CoSimulationModel, Closeable by fmu { override val modelDescription: CoSimulationModelDescription by lazy { fmu.modelDescription.asCoSimulationModelDescription() diff --git a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi2/CoSimulationFmu.kt b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi2/CoSimulationFmu.kt index 803ca51b..86c4bea3 100644 --- a/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi2/CoSimulationFmu.kt +++ b/fmi-import/src/main/kotlin/no/ntnu/ihb/fmi4j/importer/fmi2/CoSimulationFmu.kt @@ -24,8 +24,7 @@ package no.ntnu.ihb.fmi4j.importer.fmi2 -import no.ntnu.ihb.fmi4j.CosimulationModel -import no.ntnu.ihb.fmi4j.Model +import no.ntnu.ihb.fmi4j.CoSimulationModel import no.ntnu.ihb.fmi4j.SlaveInstance import no.ntnu.ihb.fmi4j.importer.fmi2.jni.CoSimulationLibraryWrapper import no.ntnu.ihb.fmi4j.importer.fmi2.jni.Fmi2CoSimulationLibrary @@ -35,7 +34,7 @@ import java.io.Closeable class CoSimulationFmu( private val fmu: Fmu -) : CosimulationModel, Closeable by fmu { +) : CoSimulationModel, Closeable by fmu { override val modelDescription: CoSimulationModelDescription by lazy { fmu.modelDescription.asCoSimulationModelDescription()