Closed AlexisDrogoul closed 8 years ago
It is the same case for list.
list
Bad news: there are two types named road
(one in the imported micro-model, the other in the comodel). Good news: they both reference the same instance of species description. So, either we use the "parent" mechanism of the types managers, letting the comodel one inherit from the imported model ones, or we simply patch the isAssignable
method to return true when two different types refer to the same species. I'm a bit worried to have two types with the same name in a model, but this might be the quickest way to fix this issue.
Dear Alexis, I saw that it have 2 types named "road" and surely it point to the same species, but I did not find out how to separate it in the level of syntax. I have proposed but it may be to complex to implement: adding the prefix to the type, e.g. Traffic."Adapter".road r1; to distinct with the existing type road of comodel.
If not, the patch of isAssignable() is a significant solution for me in the following case: Considering the micro-models are the legacy-models, so in most of the cases, these models have the species with the same common names (like road, building). Currently, the using of such kind micro-model still not works (may be new issue).
Hmmm.. I dont really get it. That's because Traffic.road
doesn't work as a type, that's it ?
So the two types point to the same species, but they should represent two different populations ?
Dear Alexis, Yes, Traffic.Road does not work as a type. If it work, it will solve another issue that I have mentioned: several micro-models would have species of the same name (many model have the roads, buildings....) and we did not have a solution to distinct them. It should have only 1 type and it must be Traffic.Road and represent 1 populations of Road in micro-model. The existing type "Road" in comodel is so ambiguous if it can point to micro-model's population without any prefix.
Hi, regarding the syntax, I can propose you Traffic<road>
instead of Traffic.road
. Not sure yet if we can evaluate this correctly, but at least it is on par with the other definitions of types.
Dear Alexis,
Can we have the reverse road
"road < Traffic > r"; // is a ROAD variable and it come from Traffic model
Hum... I dont get it. The semantics of the <
is not completely fixed (for instance species<road>
means any species subclassing road
) and it seems to me more logical to firstly describe the container (in that case, Traffic
, a model) and then the contents (in that case road
). Dont you agree ? Besides, what would "a TRAFFIC variable and the element type is road" represent ? Traffic
is not a list nor a map ...
I am ok with the "species < road > means any species subclassing road".
"a TRAFFIC variable and the element type is road" represent what I could be confused with the syntax of list < int > .
Well, since models are not containers (lists, maps, matrices, etc.) there can't be any confusion in my opinion.
Another question is what to do with road
once we make these changes. Should we register it as a type in the co-model or not ?
Dear Alexis,
road in co-model should not be registered. I preferred to use explicitly the origin of species , from which micro-models.
road is a species declared in co-model
Traffic
Sorry -- I'm lost. For me, Traffic should be a species of the co-model, and road a species (a type) of Traffic. Or maybe I got your explanation wrong ?
No, you are right, GitHub eliminate my all < and > I meant: road is a species declared in co-model Traffic < road > is a species declared in micro-model traffic Urban < road > is a species declared in micro-model urban
I agree , Traffic is a species (alias of model traffic) of the co-model, but Traffic < road > must directly point to the species "road" in micro-model instead of having a false type road in co-model as now.
Steps to reproduce
Expected behavior
There shouldn't be any warning
Actual behavior
Funny warning instead (a bit like those on Windows OS !):
r1 of type road is assigned a value of type road, which will be casted to road
...System and version
Latest GIT version