gpz, on 08 August 2020 - 02:29 AM, said:
To me, it seems clear - if you add a "Train" reference to a List[] consist, that's merging a sequence, and if you reference a Random[] consist, that's selecting from a pile.
Using dedicated keywords would seem to limit our flexibility. In the future, I intend to add more consist types, like ranked preferences and equipment pools. Would we be required to add more keywords for those? What if I change one of my consists from a List[] type to a Random[] type; will I have to go back and repair all of the referencing consists?
(By the way, if it's the "Train" name you object to, I am increasingly of the opinion we should just stick with "Consist!")
gpz, on 08 August 2020 - 02:17 AM, said:
roeter, on 08 August 2020 - 04:46 AM, said:
The reverse can also happen. A freight train may consists of a fixed number of blocks, as that is the load assigned to that train, e.g. to supply a set of clients at a certain location. But the formation of each block itself could be random (and even empty!) depending of the required transport needs at that time.
Say, for instance, that a freight train takes blocks for industries I1, I2 and I3. One day, the group for I1 consists of 3 wagons, I2 of 2 wagons and I3 of 4 wagons.
But the next day, it may be that the block for I1 is empty, I2 has 7 wagons and I3 only 1. Such a freight actually passes my house a couple of days a week, and I do regularly see such variations.
Both cases are fully supported, and are exactly the kinds of scenarios I envisioned for this system.
While the top-level "activity consist" (or "train") will be restricted to being a List[] type, it will be able to reference other consists that can be of other types, which in turn can reference yet more consists. Nesting is quite possible via the reference system; it's just that every consist has to have a filename, so no "anonymous" nested consists are allowed.
I am open to supporting anonymous nesting, too, but in the long-term I still see an editor as being the primary way to create consists, so I don't know how many people would make use of such a feature.
roeter, on 08 August 2020 - 05:14 AM, said:
So actually, I do not envision giving the activity or timetable subsystems access to the consist hierarchy. As far as they're concerned, the consist is just a flat formation of wagons.
Of course, if they spawn multiple consists strung together, they will be able to retain information on which cars were spawned by which consist, but they'll only have access to the top level.
I am also open to changing this, but I'll have to see some proposed used cases and attributes.