3
* @brief Prototypes for utility functions.
5
/* biosim - A simulator for the predator-prey relationship of aphids and
8
* Copyright (c) 2010, Tilman Blumenbach <tilman@ax86.net>
11
* Redistribution and use in source and binary forms, with or without
12
* modification, are permitted provided that the following conditions are
14
* - Redistributions of source code must retain the above copyright notice,
15
* this list of conditions and the following disclaimer.
16
* - Redistributions in binary form must reproduce the above copyright
17
* notice, this list of conditions and the following disclaimer in the
18
* documentation and/or other materials provided with the distribution.
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
24
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30
* THE POSSIBILITY OF SUCH DAMAGE.
38
* @brief Initialize the random number generator (RNG).
40
* This function MUST be called on Windows before calling rand_get().
42
int rand_init( void );
45
* @brief De-initialize / destroy the random number generator.
47
* This function should be called on Windows when rand_get() is not needed
50
void rand_destroy( void );
54
* @brief Get a (pseudo) random number between \c min and \c max inclusive.
55
* @param min The smallest integer to return (lower limit).
56
* @param max The biggest integer to return (upper limit).
57
* @return A random number between \c min and \c max inclusive.
59
int rand_get( unsigned int min, unsigned int max );
61
#endif /* ifndef UTIL_H */