• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

random numbers from Gamma distirbution

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I generate random numbers from gamma(2, 3)? I've seen 3 packages, but none works for me. I am running OS X Lion, it didn't work on my friend's PC either.
1. SSJ from University of Montreal
http://www.iro.umontreal.ca/~simardr/ssj/indexe.html

2. The JSC library
http://www.jsc.nildram.co.uk/downloads/download.html

3. The eduni package
http://www.icsa.inf.ed.ac.uk/research/groups/hase/simjava/distributions/

I right-clicked my class, add External Jars, clicked ok. Am I not importing them right?

But I just can't use it, very frustrating, how is everyone else dealing with this?
 
Ranch Hand
Posts: 144
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These packages have their requirements

1. JSC: J2SE v1.4.1

2. SSj: Compatable with JDK 5.0

3. ICSA: JDK 1.4

Just select the package that you need to use and import it. I do not see any reason why it would not work.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Zeeshan Sheikh wrote:These packages have their requirements

1. JSC: J2SE v1.4.1

2. SSj: Compatable with JDK 5.0

3. ICSA: JDK 1.4

Just select the package that you need to use and import it. I do not see any reason why it would not work.



Could you be more specific? Been trying to import for couple hours.

I have all 3 added.

When I type: import eduni.distributions.*;
There is a red underline under eduni, and I can't use it. But I see eduni.jar under reference libraries.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I am going to abandon all the above and start with this fresh!
Please look out for my back, let me know if I am doing something wrong. thanks!

Here's the API:
http://commons.apache.org/math/apidocs/org/apache/commons/math/special/Gamma.html

Here's the download site:
http://commons.apache.org/logging/download_logging.cgi

Step 1:
I downloaded under binaries
commons-logging-1.1.1-bin.tar.gz

Step 2:
unzip the folder, there are 5 .jar, I dragged commons-logging-1.1.1-sources.jar to my reference library. ONLY this one, just to try.

Step 3:
add to external in eclipse.

Now how do I import it? What should I type import? co. what is going on?!
 
Zeeshan Sheikh
Ranch Hand
Posts: 144
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I am saying JRE requirements are different for these packages.

1. Make sure you have JRE 1.4 for JSC & ICSA (These two packages can be imported together)

2. If you want to use SSJ then you need JRE 1.5 (This package can be imported alone)

3. All I am saying make sure you have right JRE version for package.

I hope you are NOT trying to run it on JRE 7. Please check requirements on their website.
 
Marshal
Posts: 79508
379
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your suggestions about version of Java™ are mistaken. It ought to work on any version newer than Java5.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:I think your suggestions about version of Java™ are mistaken. It ought to work on any version newer than Java5.



I figured it out! My problem is setting the path to /Referenced Libraries instead of under /SRC.

All the red underlines went away, yes!
 
Campbell Ritchie
Marshal
Posts: 79508
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic