Cases

<< Click to Display Table of Contents >>

Navigation:  Using SMILE >

Cases

SMILE includes management of cases, which allows users to save a partial or a complete evidence set as a case and retrieve this case at a later time. Cases are saved alongside the model (XDSL file format only), so when the model is loaded at a later time, all cases are available.

Internally, case information is stored in the DSL_case objects, which are managed by DSL_network (so your program does not create instances of this class directly). To add a case to the network, use DSL_network::AddCase, which returns a pointer to the newly created instance of the DSL_case object. To retrieve the case information, use DSL_network::GetCase.

Each case has a name (required), a category and a description (both optional). Once the case is created, your program can add evidence to the case with DSL_case::AddEvidence. Alternatively, you can copy current network evidence into the case with DSL_case::NetworkToCase.

To apply the evidence defined in the case, use DSL_case::CaseToNetwork.

DSL_case *c = net.GetCase("my_case");

for (int i = 0; i < c->GetNumberOfEvidence(); i ++)

{

 int handle, outcome;

 c->GetEvidence(i, handle, outcome);

 printf("%d %d %d\n", i, handle, outcome);

}

c->CaseToNetwork();

net.UpdateBeliefs();