[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Global random generator usage (java/Linux)
From: |
Benjamin Inden |
Subject: |
Global random generator usage (java/Linux) |
Date: |
Fri, 07 Dec 2001 18:17:37 +0100 |
Hi,
I wonder how I can use the global random generator with a Bernoulli
Distribution.
I am using Swarm 2.1.1 (SuSE RPM) with SuSE Linux 7.3 and java (Kaffe and Sun
JDK 1.3.1 installed).
Here is what I tried:
BernoulliDistImpl yesOrNo;
yesOrNo = new BernoulliDistImpl();
yesOrNo.setGenerator(Globals.env.randomGenerator);
if(yesOrNo.getSampleWithProbability(synthesisProb)) {...
However, I get the following error at runtime:
*** event raised for error: InvalidArgument
*** function: _i_Object_s__forward__(), file:
/usr/src/packages/BUILD/swarm-2.1.1/src/defobj/DefObject.m,
line: 626
unable to find Java selector `setGenerator:' in objc:`JavaProxy' 0x8712718
java: 0x8e30bb0 hash: 21094
*** execution terminating due to error
/usr/src/packages/BUILD/swarm-2.1.1/src/defobj/Symbol.m:173 -[Error(c)
_raiseEvent:]
/usr/bin/javaswarm: line 1: 1061 Aborted
CLASSPATH='.:/usr/share/swarm/swarm.jar:/usr/lib/kaffe/share/kaffe/Klasses.jar:'
/usr/lib/kaffe/libexec/Kaffe
'StartTuringCell'
-----------------------
When I comment out the "setGenerator" line, I get the following error:
*** event raised for error: InvalidArgument
*** function: _i_Object_s__forward__(), file:
/usr/src/packages/BUILD/swarm-2.1.1/src/defobj/DefObject.m,
line: 626
unable to find Java selector `getSampleWithProbability:' in objc:`JavaProxy'
0x8712718 java: 0x8e30bb0 hash:
21094
*** execution terminating due to error
/usr/src/packages/BUILD/swarm-2.1.1/src/defobj/Symbol.m:173 -[Error(c)
_raiseEvent:]
/usr/bin/javaswarm: line 1: 1883 Aborted
CLASSPATH='.:/usr/share/swarm/swarm.jar:/usr/lib/kaffe/share/kaffe/Klasses.jar:'
/usr/lib/kaffe/libexec/Kaffe
'StartTuringCell'
------------------------------
I also wonder how I can explicitly set the global random generator's initial
seed to a certain value.
I want just one integer number to determine the whole run.
Any help is appreciated.
Thanks in advance,
Benjamin Inden
address@hidden
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- Global random generator usage (java/Linux),
Benjamin Inden <=