root/tags/lgt2311/library/randomp.lgt

Revision 3687, 1.6 KB (checked in by pmoura, 21 months ago)

Code reformating.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2:- protocol(randomp).
3
4    :- info([
5        version is 1.0,
6        author is 'Paulo Moura',
7        date is 2000/7/24,
8        comment is 'Random number generator protocol.']).
9
10    :- public(random/1).
11    :- mode(random(-float), one).
12    :- info(random/1, [
13        comment is 'Returns a new random float value in the interval [0.0, 1.0[.',
14        argnames is ['Random']]).
15
16    :- public(random/3).
17    :- mode(random(+integer, +integer, -integer), zero_or_one).
18    :- mode(random(+float, +float, -float), zero_or_one).
19    :- info(random/3, [
20        comment is 'Returns a new random value in the interval [Lower, Upper[.',
21        argnames is ['Lower', 'Upper', 'Random']]).
22
23    :- public(randseq/4).
24    :- mode(randseq(+integer, +integer, +integer, -list), zero_or_one).
25    :- mode(randseq(+integer, +float, +float, -list), zero_or_one).
26    :- info(randseq/4, [
27        comment is 'Returns a list of Length random values in the interval [Lower, Upper[.',
28        argnames is ['Length', 'Lower', 'Upper', 'List']]).
29
30    :- public(randset/4).
31    :- mode(randset(+integer, +integer, +integer, -list), zero_or_one).
32    :- mode(randset(+integer, +float, +float, -list), zero_or_one).
33    :- info(randset/4, [
34        comment is 'Returns an ordered set of Length random values in the interval [Lower, Upper[.',
35        argnames is ['Length', 'Lower', 'Upper', 'Set']]).
36
37    :- public(reset_seed/0).
38    :- mode(reset_seed, one).
39    :- info(reset_seed/0, [
40        comment is 'Resets the random seed to its default value.']).
41
42    :- public(set_seed/1).
43    :- mode(set_seed(+integer), zero_or_one).
44    :- info(set_seed/1, [
45        comment is 'Sets the random seed to the given value.',
46        argnames is ['Seed']]).
47
48:- end_protocol.
Note: See TracBrowser for help on using the browser.