Add more solution space constraints

  • Adding more constraints, will guide the search for interesting solutions further.

  • Recall the feature model and meta-model:

abstract xor trackLine
single
dual
abstract RegionalStationConf
main_tracks : trackLine
tracks_in : trackLine
tracks_out : trackLine
parking_track ?
abstract Track
incident -> Track 0..3
[ parent in this.incident ]
[ no this&incident ]
abstract SimpleTrack : Track
[ # incident = 2 ]
abstract Junction : Track
[ # incident = 3 ]
abstract Line : Track
[ one incident ]
abstract TrackBarrier : Track
[ one incident ]
  • We extend the Station clafer with a few more properties:
abstract Station
T : SimpleTrack 1..3
[ lone incident&I ]
[ lone incident&O ]// a track should not connect more than one inputs
J : Junction 0..4 // (outputs)
I : Line 1..2
O : Line 0..2
B : TrackBarrier 0..2
// a station must be self contained
[ T.incident in T++J++I++O++B ]
[ J.incident in T++J++I++O ]
[ I.incident in T++J++I++O ]
[ O.incident in T++J++I++O ]
[ B.incident in T ]
  • Let’s instantiate a station.
MyStation : Station
  • Investigate some legal stations in Clafer IDE. Stop at the first instance that is ‘weird’ (it should not take more than three instances normally):

It looks like we need to next Add more solution space constraints


Previous

Part I

  1. Commonality
  2. Variability
  3. Do not Repeat Yourself
  4. Domain Constraints

Part II

  1. Station Building Blocks

Part III

  1. Base Model