Commit 6ea9adb4 authored by Christina's avatar Christina

extended logic base

parent 274f6b33
Pipeline #301023 failed with stages
in 2 minutes and 11 seconds
......@@ -130,7 +130,7 @@
}
},
"attributesSimulation" : {
"finishTime" : 250.0,
"finishTime" : 10.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
......@@ -220,9 +220,9 @@
} ],
"measurementAreas" : [ {
"shape" : {
"x" : 58.0,
"x" : 68.0,
"y" : 40.0,
"width" : 20.0,
"width" : 10.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
......@@ -335,12 +335,12 @@
"nextSpeed" : -1.0
}, {
"id" : 2004,
"absorbing" : true,
"absorbing" : false,
"shape" : {
"x" : 62.4,
"y" : 17.4,
"width" : 9.0,
"height" : 2.5,
"x" : 60.1,
"y" : 19.2,
"width" : 14.0,
"height" : 0.5,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
......@@ -350,6 +350,23 @@
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 5001,
"absorbing" : false,
"shape" : {
"x" : 64.6,
"y" : 10.2,
"width" : 5.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 30.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"targetChangers" : [ {
"id" : 4,
......@@ -390,6 +407,19 @@
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 1 ],
"probabilityToChangeTarget" : [ 1.0 ]
}, {
"id" : 9,
"shape" : {
"x" : 60.1,
"y" : 4.2,
"width" : 14.1,
"height" : 4.0,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 5001, 2002 ],
"probabilityToChangeTarget" : [ 1.0 ]
} ],
"absorbingAreas" : [ ],
"sources" : [ {
......@@ -402,7 +432,7 @@
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.NegativeExponentialDistribution",
"distributionParameters" : [ 0.6 ],
"distributionParameters" : [ 2.5 ],
"spawnNumber" : 5,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
......
......@@ -55,9 +55,9 @@ public class RouteChoiceThreeCorridors implements INavigationModel {
private int getTargetFromFuzzyController(double density,double densityCor1,double densityCor2,double densityCor3) {
fis.setVariable("density", density); // Set inputs
fis.setVariable("densityCor1", densityCor1);
fis.setVariable("densityCor1", densityCor3);
fis.setVariable("densityCor2", densityCor2);
fis.setVariable("densityCor3", densityCor3);
fis.setVariable("densityCor3", densityCor1);
fis.evaluate(); // Evaluate
double corridor = fis.getVariable("corridor").getValue();
......
......@@ -24,27 +24,23 @@ VAR_OUTPUT // Define output variable
END_VAR
FUZZIFY density
TERM low := (0, 1) (0.25, 0) ;
TERM medium := (0.2, 0) (0.3,1) (0.4,0);
TERM high := (0.3, 0) (4.5, 1);
TERM low := (0, 1) (0.5, 0) ;
TERM high := (0.4, 0) (5.5,1);
END_FUZZIFY
FUZZIFY densityCor1
TERM low := (0, 1) (0.25, 0) ;
TERM medium := (0.2, 0) (0.3,1) (0.4,0);
TERM high := (0.3, 0) (4.5, 1);
TERM high := (0.2, 0) (4.5, 1);
END_FUZZIFY
FUZZIFY densityCor2
TERM low := (0, 1) (0.25, 0) ;
TERM medium := (0.2, 0) (0.3,1) (0.4,0);
TERM high := (0.3, 0) (4.5, 1);
TERM low := (0, 1) (0.25, 0) ;
TERM high := (0.2, 0) (4.5, 1);
END_FUZZIFY
FUZZIFY densityCor3
TERM low := (0, 1) (0.25, 0) ;
TERM medium := (0.2, 0) (0.3,1) (0.4,0);
TERM high := (0.3, 0) (4.5, 1);
TERM low := (0, 1) (0.25, 0) ;
TERM high := (0.2, 0) (4.5, 1);
END_FUZZIFY
DEFUZZIFY corridor //
......@@ -53,7 +49,7 @@ DEFUZZIFY corridor //
TERM use1 := (2002,0) (2003,1) (2004,0);
TERM sendAway := (2003,0) (2004,1) (2005,0);
METHOD : COG; // Use 'Center Of Gravity' defuzzification method
DEFAULT := 0; // Default value is 0 (if no rule activates defuzzifier)
DEFAULT := 2004; // Default value is 0 (if no rule activates defuzzifier)
END_DEFUZZIFY
RULEBLOCK No1
......@@ -61,10 +57,20 @@ RULEBLOCK No1
ACT : MIN; // Use 'min' activation method
ACCU : MAX; // Use 'max' accumulation method
RULE 1 : IF density IS high AND densityCor1 is high AND densityCor2 is high AND densityCor3 is high THEN corridor IS sendAway;
RULE 2 : If densityCor1 IS high AND densityCor2 is low THEN corridor is use2;
RULE 3 : If densityCor1 IS high AND densityCor2 is high THEN corridor is use3;
RULE 3 : If densityCor1 IS low OR densityCor1 IS medium THEN corridor is use1;
RULE 1 : If density IS low AND densityCor1 IS low AND densityCor2 is low AND densityCor3 IS low THEN corridor is use1;
RULE 2 : If density IS low AND densityCor1 IS high AND densityCor2 is low AND densityCor3 IS low THEN corridor is use2;
RULE 3 : If density IS low AND densityCor1 IS high AND densityCor2 is high AND densityCor3 IS low THEN corridor is use3;
RULE 4 : If density IS low AND densityCor1 IS high AND densityCor2 is high AND densityCor3 IS high THEN corridor is sendAway;
RULE 5 : If density IS high AND densityCor1 IS low AND densityCor2 is low AND densityCor3 IS low THEN corridor is use3;
RULE 6 : If density IS high AND densityCor1 IS high AND densityCor2 is low AND densityCor3 IS low THEN corridor is use3;
RULE 7 : If density IS high AND densityCor1 IS high AND densityCor2 is high AND densityCor3 IS low THEN corridor is use3;
RULE 8 : If density IS high AND densityCor1 IS high AND densityCor2 is high AND densityCor3 IS high THEN corridor is sendAway;
END_RULEBLOCK
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment