Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Setting the random seed  (Read 1687 times)
0 Members and 1 Guest are viewing this topic.
Offline Vikstar

Senior Newbie





« Posted 2004-08-23 00:33:57 »

Is there a way to set the random seed in odejava? The way it is done in ODE is through the use of the "void dRandSetSeed(long)" function in misc.cpp. This is useful for exactly recreating simulations without the need to save position and other data at each step (as long as no other randomness is introduced such as user input).
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-08-26 21:51:44 »

There doesn't appear to be, although there should be.

How desperatly do you need it?

It can be added to org.odejava.ode.Ode by adding the relevent line in odejava.i (in odejava/combile/odejava), then running swig to regenerate the wrappers (including Ode.java), and recompiling the natives.

I shall add it in next time I update the binaries but I wasn't planning to for another few months.

Will.

Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #2 - Posted 2004-08-28 10:36:28 »

My simulations are required to be repeatable. I had to make all my random numbers come from my own seed but I never had to setup the ode random seed. What functions in ode use the seed? I may need to set this random seed in ODE as well in the future.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-08-29 07:24:35 »

not 100% sure, the mailing list will be able to answer though Smiley

I'll definitally add it in next time I do a build.

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-08-30 23:02:53 »

I've added this in - all you need to do is add the line "void dRandSetSeed (long seed);" to odejava.i and recompile the natives.

When the cylinder stuff is fixed up I shall release new natives.  Any more functions that you need?

Will.

Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #5 - Posted 2004-09-05 20:52:45 »

Vikstar have you used the random seed thing yet? I have put it into mine but my simulations are not deterministic after a reset. If I close down java and resart, everything is sweet. But it I run a simulation twice in the same VM, everything does slightly different things. It still looks real, but positions and orientations quickly diverge thanks to bloody chaos thoery.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline Vikstar

Senior Newbie





« Reply #6 - Posted 2004-09-07 02:43:07 »

I haven't tried it yet, still trying to develop persistance for my framework.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #7 - Posted 2004-10-30 04:09:37 »

dRandSetSeed is now implemented in Odejava.

Will.

Offline gafferuk

Senior Newbie





« Reply #8 - Posted 2004-10-31 14:52:30 »

And how do we set it? Thanks in advance.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #9 - Posted 2004-10-31 20:06:19 »

Ode.dRandSetSeed(long )

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (43 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!