baumfalk / TrafficMAS

TrafficMAS, the code
MIT License
0 stars 0 forks source link

Define norms in XML #31

Closed baumfalk closed 9 years ago

baumfalk commented 9 years ago

I'm leaning towards this

<norms>
    <norm id="norm1">
        <condition value="speedCarX50 AND @(CarX,A28)" />
        <obligation value="speedCarX30 OR lane(CarX,lane5)" />
        <deadline value="@(CarX,A29)" />
        <sanction value="fine50" />
    </norm>
</norms>
Maxic commented 9 years ago

Currently only adding custom norm schemes, like such:

<norm_schemes>
    <norm_scheme id="ramp-merging">     
        <sensors value="3"/>
        <sanction value="LowFine"/>
    </norm_scheme>  
</norm_schemes>

More detailed explanation in issue #30

Maxic commented 9 years ago

XML files like the one below can be parsed and read into our MAS as of commit fb80976.

<norm_schemes>
    <norm_scheme id="maxspeed"  classname="SimpleMaxSpeedNormScheme"  sanction="LowFine" >
        <sensor id="A28_350_lane0_s1" /> <!-- main road sensor-->
        <sensor id="A28_350_lane0_s2" /> <!-- access road sensor -->
    </norm_scheme>     
</norm_schemes>

The order in which the sensors are listed is important and needs to documented somewhere.