Open davidenitti opened 9 years ago
Currently we have some issues with constructing literal matrices like [Agent(prev(t))[0][0]; Agent(prev(t))[0][1]+1]
, especially when the arguments are integers instead of reals.
I would recommend defining AgentRow and AgentColumn as separate scalar functions, instead of having the function Agent that returns a matrix.
Dear, I am trying to implement a probabilistic version of the Wumpus world, but I have this error:
Exception in thread "main" java.lang.ClassCastException: java.util.ArrayList cannot be cast to blog.common.numerical.MatrixLib at blog.model.BuiltInFunctions$25.getValue(BuiltInFunctions.java:1053) at blog.model.FixedFunction.getValueInInterpretation(FixedFunction.java:193) at blog.model.FixedFunction.getValueInContext(FixedFunction.java:231) at blog.model.FuncAppTerm.evaluate(FuncAppTerm.java:156) at blog.model.FuncAppTerm.evaluate(FuncAppTerm.java:144) at blog.model.FuncAppTerm.evaluate(FuncAppTerm.java:144) at blog.model.EqualityFormula.evaluate(EqualityFormula.java:75) at blog.model.CaseSpec.evaluate(CaseSpec.java:55) at blog.model.CaseSpec.evaluate(CaseSpec.java:63) at blog.model.CaseSpec.evaluate(CaseSpec.java:63) at blog.model.DependencyModel.getDistrib(DependencyModel.java:151) at blog.model.DependencyModel.getDistribWithBinding(DependencyModel.java:140) at blog.bn.RandFuncAppVar.getDistrib(RandFuncAppVar.java:117) at blog.sample.ClassicInstantiatingEvalContext.instantiate(ClassicInstantiatingEvalContext.java:154) at blog.sample.ClassicInstantiatingEvalContext.getOrComputeValue(ClassicInstantiatingEvalContext.java:116) at blog.sample.ParentRecEvalContext.getValue(ParentRecEvalContext.java:75) at blog.bn.VarWithDistrib.ensureDetAndSupported(VarWithDistrib.java:129) at blog.BLOGUtil.ensureDetAndSupported(BLOGUtil.java:34) at blog.BLOGUtil.ensureDetAndSupported(BLOGUtil.java:44) at blog.engine.Particle.answer(Particle.java:84) at blog.engine.ParticleFilter.takeEvidenceAndAnswerQuery(ParticleFilter.java:174) at blog.engine.ParticleFilter.answerQueries(ParticleFilter.java:127) at blog.Main.run(Main.java:220) at blog.Main.main(Main.java:158)
the code is this:
I think the error is related to the line:
that is I need to check if the maze cell above the agent position is free. is there any error in this? thanks!