I am new to Figaro and I would like to create a model that will be used in more than one actor. In fact I have created a router with workers. They execute in different threads as you know.
Each worker actor creates new instance of a class that creates the model, all variables, then make evidences and Inferences with VariableElimination. When I create only one worker, that is there is no multithreading, it works perfectly. Bu with more than one I got this error:
key not found: Select(0.01 -> 'visit, 0.99 -> 'novisit)
I have implemented the well known ChestClinic model like this:
As you can see I have create a new Universe and created the variables in it. The msgIndex is an Int that indexes each worker actor created. Before that, using the default universe, it never worked but after that sometimes I can create the model, but the error appears in some executions.
The VariableElimination comes just after the model creation:
val tbPriorAlg = VariableElimination(tuberculosisOrCancer) (universe)
tbPriorAlg.start()
val tbPrior = tbPriorAlg.probability(tuberculosisOrCancer, true)
if(isDebug) println("Prior probability the Tuberculosis Or Cancer on = " + tbPrior.toString)
But even if I remove the VariableElimination, the error occurs.
Hi,
I am new to Figaro and I would like to create a model that will be used in more than one actor. In fact I have created a router with workers. They execute in different threads as you know.
Each worker actor creates new instance of a class that creates the model, all variables, then make evidences and Inferences with VariableElimination. When I create only one worker, that is there is no multithreading, it works perfectly. Bu with more than one I got this error: key not found: Select(0.01 -> 'visit, 0.99 -> 'novisit)
I have implemented the well known ChestClinic model like this:
As you can see I have create a new Universe and created the variables in it. The msgIndex is an Int that indexes each worker actor created. Before that, using the default universe, it never worked but after that sometimes I can create the model, but the error appears in some executions.
The VariableElimination comes just after the model creation:
But even if I remove the VariableElimination, the error occurs.
Can you help me ?
Thanks in advance