Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Invalid import clause in ThirdSpecies #469

Open
henrikt-ma opened this issue Oct 10, 2024 · 0 comments
Open

Invalid import clause in ThirdSpecies #469

henrikt-ma opened this issue Oct 10, 2024 · 0 comments

Comments

@henrikt-ma
Copy link

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}})));
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant