1.25. Situation Recognition¶
The situation recognition uses information from various sensors to provide an abstracted mental model of the current state of the apartment and its content.
1.25.2. Interfaces¶
The informers are used to publish the updates in evidence, situation recognition result as and the used bayes network.
The api is available for two separate networks.
- situation is a general purpose network for situation recognition in the csra.
prefix=/citec/csra/home/situation
- addressee recognizes whether flobi was addressed in the kitchen or entrance.
prefix=/citec/csra/home/addressee
Scope (Informer) | Type |
---|---|
$prefix/result |
ClassificationResultMap |
$prefix/evidence |
BayesNetworkEvidence |
$prefix/network |
BayesNetwork |
With the listeners the evidence can be set for testing or learning purposes and the network used for recognition can be set.
Scope (Listener) | Type |
---|---|
$prefix/override/evidence/override |
ClassificationResultMap |
$prefix/override/evidence/learn |
ClassificationResultMap |
$prefix/override/network/ |
BayesNetwork |
The local servers can be used to pull the current bayesian network and situation.
Scope (Local Server) + Method | Return Type |
---|---|
$prefix/result/get() |
ClassificationResultMap |
$prefix/network/get() |
BayesNetwork |
1.25.3. Situation Network¶
The following graph is used in the situation recognition:
The following graph is used in the addressee recognition:
1.25.4. Examples¶
Find out if Flobi has the attention of someone in the kitchen and print the information:
ClassificationResultMapType.ClassificationResultMap situation = (ClassificationResultMapType.ClassificationResultMap) event.getData();
if(situation.getAspectsList().stream()
.filter(aspect -> aspect.getName().equals("Attention_Flobi_Kitchen"))
.filter(aspect -> aspect.getResult().getDecidedClass().equals("Some"))
.findAny().isPresent())
{
System.out.println("Flobi has attention.");
} else {
System.out.println("Flobi does not have attention.");
}