Assert.assertEquals(
"if [car-in-front-is-braking==true || car-in-front-tires-smoking==true] then Action[name==emergency-braking].",
r.toString());
Assert.assertEquals(true, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_IS_BRAKING, true)));
Assert.assertEquals(true, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_TIRES_SMOKING, true)));
Assert.assertEquals(true, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_IS_BRAKING, true,
ATTRIBUTE_CAR_IN_FRONT_TIRES_SMOKING, true)));
Assert.assertEquals(true, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_IS_BRAKING, false,
ATTRIBUTE_CAR_IN_FRONT_TIRES_SMOKING, true)));
Assert.assertEquals(true, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_IS_BRAKING, true,
ATTRIBUTE_CAR_IN_FRONT_TIRES_SMOKING, false)));
Assert.assertEquals(false, r.evaluate(new DynamicPercept(
ATTRIBUTE_CAR_IN_FRONT_IS_BRAKING, false,
ATTRIBUTE_CAR_IN_FRONT_TIRES_SMOKING, false)));
}