Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with VariableElimination.probability #742

Open
pouriadodido opened this issue May 14, 2018 · 6 comments
Open

Dealing with VariableElimination.probability #742

pouriadodido opened this issue May 14, 2018 · 6 comments
Assignees

Comments

@pouriadodido
Copy link

pouriadodido commented May 14, 2018

I'm a beginer in figaro and my IDE is Intellij. when I run a simple code without println(VariableElimination.probability()), I dont have any error. but when I use it .......
this is my program for testing:

import com.cra.figaro.language._
import com.cra.figaro.algorithm.factored.VariableElimination

object testFigaro {
def main(args: Array[String]){
val sunnyToday = Flip(0.2)
println(VariableElimination.probability(sunnyToday, true))
}
}

And this is error:

Exception in thread "main" java.lang.NoClassDefFoundError: scala/reflect/runtime/package$
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.makeResultFactor(VariableElimination.scala:238)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.finish(VariableElimination.scala:242)
at com.cra.figaro.algorithm.factored.VariableElimination.$anonfun$doElimination$5(VariableElimination.scala:175)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at com.cra.figaro.algorithm.factored.VariableElimination.optionallyShowTiming(VariableElimination.scala:63)
at com.cra.figaro.algorithm.factored.VariableElimination.doElimination(VariableElimination.scala:175)
at com.cra.figaro.algorithm.factored.VariableElimination.doElimination$(VariableElimination.scala:163)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.doElimination(VariableElimination.scala:213)
at com.cra.figaro.algorithm.factored.VariableElimination.ve(VariableElimination.scala:160)
at com.cra.figaro.algorithm.factored.VariableElimination.ve$(VariableElimination.scala:155)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.ve(VariableElimination.scala:213)
at com.cra.figaro.algorithm.factored.VariableElimination.run(VariableElimination.scala:186)
at com.cra.figaro.algorithm.factored.VariableElimination.run$(VariableElimination.scala:186)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.run(VariableElimination.scala:213)
at com.cra.figaro.algorithm.OneTime.doStart(OneTime.scala:28)
at com.cra.figaro.algorithm.OneTime.doStart$(OneTime.scala:26)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.doStart(VariableElimination.scala:213)
at com.cra.figaro.algorithm.Algorithm.start(Algorithm.scala:83)
at com.cra.figaro.algorithm.Algorithm.start$(Algorithm.scala:80)
at com.cra.figaro.algorithm.factored.ProbQueryVariableElimination.start(VariableElimination.scala:213)
at com.cra.figaro.algorithm.factored.VariableElimination$.probability(VariableElimination.scala:359)
at com.cra.figaro.algorithm.factored.VariableElimination$.probability(VariableElimination.scala:369)
at testFigaro$.main(testFigaro.scala:7)
at testFigaro.main(testFigaro.scala)
Caused by: java.lang.ClassNotFoundException: scala.reflect.runtime.package$
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more

Please help me
What should I do to deal with?

@mreposa
Copy link
Contributor

mreposa commented May 14, 2018

Do you have Scala installed and on your execution path?

@mreposa mreposa self-assigned this May 14, 2018
@pouriadodido
Copy link
Author

I'm not sure.

@mreposa
Copy link
Contributor

mreposa commented May 14, 2018

That's OK.... I can help you figure that out. Are you using Windows for your operating system?

@pouriadodido
Copy link
Author

Thanks. yes my OS is Win.

@mreposa
Copy link
Contributor

mreposa commented May 17, 2018

My apologies for the delay..... to verify Scala is installed, open a Windows command prompt and type:

scala -version

You should see output similar to this (depending on your Scala version):

Scala code runner version 2.12.4 -- Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.

If you don't get this response, you should go to the Scala Web site and download the version of Scala for Windows that matches the version of Figaro you're working with (for instance, Figaro 5.0 requires Scala 2.12.2 or higher).

@verrchu
Copy link

verrchu commented Sep 15, 2018

got the same issue on macOS with Scala 12.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants