Java Doc for ValueServer.java in  » Science » Apache-commons-math-1.1 » org » apache » commons » math » random » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Apache commons math 1.1 » org.apache.commons.math.random 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.math.random.ValueServer

ValueServer
public class ValueServer (Code)
Generates values for use in simulation applications.

How values are generated is determined by the mode property.

Supported mode values are:

  • DIGEST_MODE -- uses an empirical distribution
  • REPLAY_MODE -- replays data from valuesFileURL
  • UNIFORM_MODE -- generates uniformly distributed random values with mean = mu
  • EXPONENTIAL_MODE -- generates exponentially distributed random values with mean = mu
  • GAUSSIAN_MODE -- generates Gaussian distributed random values with mean = mu and standard deviation = sigma
  • CONSTANT_MODE -- returns mu every time.

version:
   $Revision: 171283 $ $Date: 2005-05-21 22:25:44 -0700 (Sat, 21 May 2005) $


Field Summary
final public static  intCONSTANT_MODE
    
final public static  intDIGEST_MODE
    
final public static  intEXPONENTIAL_MODE
    
final public static  intGAUSSIAN_MODE
    
final public static  intREPLAY_MODE
    
final public static  intUNIFORM_MODE
    

Constructor Summary
public  ValueServer()
    
public  ValueServer(RandomData randomData)
     Construct a ValueServer instance using a RandomData as its source of random data.

Method Summary
public  voidcloseReplayFile()
     Closes valuesFileURL after use in REPLAY_MODE.
public  voidcomputeDistribution()
     Computes the empirical distribution using values from the file in valuesFileURL, using the default number of bins.
public  voidcomputeDistribution(int binCount)
     Computes the empirical distribution using values from the file in valuesFileURL and binCount bins.
public  voidfill(double[] values)
     Fills the input array with values generated using getNext() repeatedly.
public  double[]fill(int length)
     Returns an array of length length with values generated using getNext() repeatedly.
public  EmpiricalDistributiongetEmpiricalDistribution()
     Getter for property empiricalDistribution.
public  intgetMode()
     Getter for property mode.
public  doublegetMu()
     Getter for property mu.
public  doublegetNext()
     Returns the next generated value, generated according to the mode value (see MODE constants).
public  doublegetSigma()
     Getter for property sigma.
public  URLgetValuesFileURL()
    
public  voidresetReplayFile()
     Resets REPLAY_MODE file pointer to the beginning of the valuesFileURL.
public  voidsetMode(int mode)
     Setter for property mode.
public  voidsetMu(double mu)
     Setter for property mu.
public  voidsetSigma(double sigma)
     Setter for property sigma.
public  voidsetValuesFileURL(String url)
    
public  voidsetValuesFileURL(URL url)
    

Field Detail
CONSTANT_MODE
final public static int CONSTANT_MODE(Code)
Always return mu



DIGEST_MODE
final public static int DIGEST_MODE(Code)
Use empirical distribution



EXPONENTIAL_MODE
final public static int EXPONENTIAL_MODE(Code)
Exponential random deviates with mean = mu



GAUSSIAN_MODE
final public static int GAUSSIAN_MODE(Code)
Gaussian random deviates with mean = mu, std dev = sigma



REPLAY_MODE
final public static int REPLAY_MODE(Code)
Replay data from valuesFilePath



UNIFORM_MODE
final public static int UNIFORM_MODE(Code)
Uniform random deviates with mean = mu




Constructor Detail
ValueServer
public ValueServer()(Code)
Creates new ValueServer



ValueServer
public ValueServer(RandomData randomData)(Code)
Construct a ValueServer instance using a RandomData as its source of random data.
Parameters:
  randomData - the RandomData instance used to source random data
since:
   1.1




Method Detail
closeReplayFile
public void closeReplayFile() throws IOException(Code)
Closes valuesFileURL after use in REPLAY_MODE.
throws:
  IOException - if an error occurs closing the file



computeDistribution
public void computeDistribution() throws IOException(Code)
Computes the empirical distribution using values from the file in valuesFileURL, using the default number of bins.

valuesFileURL must exist and be readable by *this at runtime.

This method must be called before using getNext() with mode = DISGEST_MODE
throws:
  IOException - if an I/O error occurs reading the input file




computeDistribution
public void computeDistribution(int binCount) throws IOException(Code)
Computes the empirical distribution using values from the file in valuesFileURL and binCount bins.

valuesFileURL must exist and be readable by *this at runtime.

This method must be called before using getNext() with mode = DISGEST_MODE
Parameters:
  binCount - the number of bins used in computing the empiricaldistribution
throws:
  IOException - if an error occurs reading the input file




fill
public void fill(double[] values) throws IOException(Code)
Fills the input array with values generated using getNext() repeatedly.
Parameters:
  values - array to be filled
throws:
  IOException - in REPLAY_MODE if a file I/O error occurs



fill
public double[] fill(int length) throws IOException(Code)
Returns an array of length length with values generated using getNext() repeatedly.
Parameters:
  length - length of output array array of generated values
throws:
  IOException - in REPLAY_MODE if a file I/O error occurs



getEmpiricalDistribution
public EmpiricalDistribution getEmpiricalDistribution()(Code)
Getter for property empiricalDistribution. Value of property empiricalDistribution.



getMode
public int getMode()(Code)
Getter for property mode. Value of property mode.



getMu
public double getMu()(Code)
Getter for property mu. Value of property mu.



getNext
public double getNext() throws IOException(Code)
Returns the next generated value, generated according to the mode value (see MODE constants). generated value
throws:
  IOException - in REPLAY_MODE if a file I/O error occurs



getSigma
public double getSigma()(Code)
Getter for property sigma. Value of property sigma.



getValuesFileURL
public URL getValuesFileURL()(Code)
Getter for valuesFileURL Value of property valuesFileURL.



resetReplayFile
public void resetReplayFile() throws IOException(Code)
Resets REPLAY_MODE file pointer to the beginning of the valuesFileURL.
throws:
  IOException - if an error occurs opening the file



setMode
public void setMode(int mode)(Code)
Setter for property mode.
Parameters:
  mode - New value of property mode.



setMu
public void setMu(double mu)(Code)
Setter for property mu.
Parameters:
  mu - New value of property mu.



setSigma
public void setSigma(double sigma)(Code)
Setter for property sigma.
Parameters:
  sigma - New value of property sigma.



setValuesFileURL
public void setValuesFileURL(String url) throws MalformedURLException(Code)
Sets the valuesFileURL using a string URL representation
Parameters:
  url - String representation for new valuesFileURL.
throws:
  MalformedURLException - if url is not well formed



setValuesFileURL
public void setValuesFileURL(URL url)(Code)
Sets the valuesFileURL
Parameters:
  url - New value of property valuesFileURL.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.