org.gjt.universe.accrete
Class AccreteObject

java.lang.Object
  |
  +--org.gjt.universe.accrete.AccreteObject
Direct Known Subclasses:
Blackbody, Protoplanet, StarSystem

public class AccreteObject
extends java.lang.Object

This class handles elements which are global to every object in the simulation. In particular, it provides consistent access to the central random number generator.

Copyright information

This Java class is copyright 1998 by Carl Burke. All rights reserved. Substantial sections of this code were previously distributed in different form as part of 'starform' (copyright 1989 Matthew Burdick)

This software is provided absolutely free and without warranty, including but not limited to the implied warranties of merchantability and fitness for a purpose. You may use this code for any legal purpose provided that you do not charge for it; this implies that you may use this code as a component of a commercial system as long as the additional functionality of the commercial system is greater than what this code provides and that the commercial system is not primarily intended as a simulation of solar system formation. In other words, if you want to write a science-fiction computer game that uses the code in this package to build objects which are used in the game, that's great and permitted; if you use this code to make a kickass solar-system-builder, you are not allowed to distribute that software except for free.

You are allowed and encouraged to modify this software, provided that this copyright notice remains intact. This notice may be reformatted, but not removed.

If you do use this software, I and the contributing authors listed under "Acknowledgements" would appreciate some recognition. If you make changes, I would appreciate it if you would pass those changes back to me for possible inclusion in the master. At the time this notice was prepared, my email address is cburke@mitre.org and the home page for this software is http://www.geocities.com/Area51/6902/w_accr.html.

Acknowledgements

Matt Burdick, the author of 'starform' (freeware copyright 1989); much of the code (particularly planetary environments) was adapted from this.

Andrew Folkins, the author of 'accretion' (public domain) for the Amiga; I used chunks of his code when creating my displays.

Ed Taychert of Irony Games, for the algorithm he uses to classify terrestrial planets in his tabular CGI implementation of 'starform'.

Paul Schlyter, who provided information about computing planetary positions.


Field Summary
static CustomRandom cr
           
 
Constructor Summary
AccreteObject()
           
 
Method Summary
static double about(double value, double variation)
          Returns a value within a certain uniform variation from the central value.
static double LognormalDeviate(double sigma)
          Produces a random variate whose natural logarithm is from the Gaussian with mean=0 and the specified standard deviation.
static double nextDouble()
          Returns a pseudo-random value between 0.0 and 1.0.
static double NormalDeviate()
          Produces a Gaussian random variate with mean=0, standard deviation=1.
static double random_eccentricity()
          Returns a value for orbital eccentricity between 0.0 and 1.0.
static double random_number(double inner, double outer)
          Returns a uniformly distributed random real number between the specified inner and outer bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cr

public static final CustomRandom cr
Constructor Detail

AccreteObject

public AccreteObject()
Method Detail

NormalDeviate

public static final double NormalDeviate()
Produces a Gaussian random variate with mean=0, standard deviation=1. Provides a local method with access to global random number generator.


LognormalDeviate

public static final double LognormalDeviate(double sigma)
Produces a random variate whose natural logarithm is from the Gaussian with mean=0 and the specified standard deviation. Provides a local method with access to global random number generator.

Parameters:
sigma - Standard deviation

random_number

public static final double random_number(double inner,
                                         double outer)
Returns a uniformly distributed random real number between the specified inner and outer bounds. Provides a local method with access to global random number generator.

Parameters:
inner - Minimum value desired
outer - Maximum value desired

about

public static final double about(double value,
                                 double variation)
Returns a value within a certain uniform variation from the central value. Provides a local method with access to global random number generator.

Parameters:
value - Central value
variation - Maximum (uniform) variation above or below center

random_eccentricity

public static final double random_eccentricity()
Returns a value for orbital eccentricity between 0.0 and 1.0. Provides a local method with access to global random number generator.


nextDouble

public static final double nextDouble()
Returns a pseudo-random value between 0.0 and 1.0. Provides a local method with access to global random number generator.



Copyright © 2001 Universe Dev Team All Rights Reserved.