Skip to content

Invalid import clause in ThirdSpecies #469

@henrikt-ma

Description

@henrikt-ma

The import clause in ModelicaByExample.Components.LotkaVolterra.Examples.ThirdSpecies is invalid; quoting System Modeler:

Error: ModelicaByExample.Components.LotkaVolterra.Examples.ThirdSpecies [2:3-2:3] Invalid qualified import. ModelicaByExample.Components.LotkaVolterra.Components.RegionalPopulation.InitializationOptions.FixedPopulation is an enumeration element and ModelicaByExample.Components.LotkaVolterra.Components.RegionalPopulation.InitializationOptions is a type but a qualified import must reference a package or a package element.

A simple fix is to simply not do the import:

--- a/ModelicaByExample/Components/LotkaVolterra/Examples/ThirdSpecies.mo
+++ b/ModelicaByExample/Components/LotkaVolterra/Examples/ThirdSpecies.mo
@@ -1,8 +1,7 @@
 within ModelicaByExample.Components.LotkaVolterra.Examples;
 model ThirdSpecies "Adding a third species to Lotka-Volterra"
-  import ModelicaByExample.Components.LotkaVolterra.Components.RegionalPopulation.InitializationOptions.FixedPopulation;
   extends ClassicLotkaVolterra(rabbits(initial_population=25), foxes(initial_population=2));
-  Components.RegionalPopulation wolves(init=FixedPopulation, initial_population=4)
+  Components.RegionalPopulation wolves(init=Components.RegionalPopulation.InitializationOptions.FixedPopulation, initial_population=4)
     annotation (Placement(transformation(extent={{30,40},{50,60}})));
   Components.Starvation wolf_starvation(gamma=0.4)
     annotation (Placement(transformation(extent={{70,40},{90,60}})));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions