advertisement
Appendix C Standard SIMSCRIPT II.5 Names
C.1 Functions and Routines
Function abs.f (arg)
Arguments:
arg
An
integer
or
double
value
Description: Returns the absolute value of
arg
.
Mode: The mode of
arg
.
Function and.f (arg1, arg2)
Arguments:
arg1
An
integer
value.
arg2
An
integer
value.
Description: Returns the logical product of
arg1
and
arg2.
Mode:
Integer
Function arccos.f (arg)
Arguments:
arg
A
double
value between
-1 and
+1.
Description: Returns the arc cosine of
arg
.
Mode:
Double
Function arcsin.f (arg)
Arguments:
arg
A
double
value between
-1 and
+1.
Description: Returns the arc sine of
arg
.
Mode:
Double
Function arctan.f (arg1, arg2)
Arguments:
arg1
A
double
value
arg2
A
double
value
Description: Returns the arc tangent of
arg1/arg2.
SIMSCRIPT II.5 User’s Guide
Mode:
Double
Function atot.f (arg)
Arguments:
arg
An
alpha
value.
Description: Returns a
text
value of length
1 containing
arg
.
Mode:
Text
Function beta.f (k1, k2, stream)
Arguments:
k1 k2 stream
A
double
value greater than zero specifying the power of X.
A
double
value greater than zero specifying the power of (1-X).
An
integer
value specifying the random number stream.
Mode:
Description: Returns a random sample from a beta distribution.
Double
Function binomial.f (n, p, stream)
Arguments:
n
P stream
An
integer
value specifying the number of trials.
A
double
value specifying the probability of success.
An
integer
value specifying the random number stream.
Description: Returns a random sample from a binomial distribution.
Mode:
Integer
Function concat.f (arg1, arg2, ...)
Arguments:
arg1, arg2,
...
Two or more
text
values.
Description: Returns the concatenation of
arg1, arg2, ...
Mode:
Text
Function cos.f (arg)
Arguments:
arg
A
double
value specifying an angle in radians.
Description: Returns the cosine of
arg
.
Mode:
Double
Function date.f (month, day, year)
100
Standard SIMSCRIPT II.5 Names
Arguments:
month day
An
integer
value specifying the month.
An
integer
value specifying the day within the month.
year
An
integer
value specifying the year.
Description: Returns the cumulative simulation time for the given calendar date based on values given to
origin.r.
Mode:
Integer
Routine date.r yielding date, time
Arguments:
date time
A
text
value containing the current date in the form
MM/DD/YYYY.
A
text
value containing the current time in the form
HH:MM:SS.
Description: Returns the current date and time.
Function day.f (time)
Arguments:
time
A
double
value specifying a cumulative simulation time.
Description: Returns the day portion corresponding to the simulation time based on values given to
origin.r
.
Mode:
Integer
Function descr.f (string)
Arguments:
string
A text value,
text
variable or expression.
Description: Indicates an argument to a NONSIMSCRIPT routine is passed by descriptor.
Used for VMS, ignored by UNIX systems.
Mode: n.a.
Function dim.f (array(*))
Arguments:
array(*)
An array pointer.
Description: Returns the number of elements in the array.
Mode:
Integer
Function div.f (arg1, arg2)
Arguments:
arg1
An
integer
value.
An
integer
value not equal to zero.
arg2
101
SIMSCRIPT II.5 User’s Guide
Description: Returns the truncated value of
arg1/arg2.
Mode:
Integer
Function efield.f
Arguments: None
Description: Returns the ending column of the next data field to be read by a free-form
read
statement. Returns zero if there are no more data fields.
Mode:
Integer
Function erlang.f (mu, k, stream)
Arguments:
mu k stream
A
double
value greater than zero specifying the mean.
An
integer
value greater than zero specifying the number of stages.
An
integer
value specifying the random number stream.
Description: Returns a random sample from an Erlang distribution.
Mode:
Double
Routine exit.r (status)
Arguments:
status
An
integer
value specifying an exit status.
Description: Terminates program execution passing the exit status to the command level.
Function exp.f (arg)
Arguments:
arg
A
double
value.
Description: Returns “e to the
arg
”.
Mode:
Double
Function exponential.f (mu, stream)
Arguments:
mu stream
A
double
value greater than zero specifying the mean.
An
integer
value specifying the random number stream.
Description: Returns a random sample from an exponential distribution.
Mode:
Double
102
Standard SIMSCRIPT II.5 Names
Function fixed.f (txt, len)
Arguments:
txt len
A
text
value.
A non-negative
integer
value.
Description: Returns a copy of
txt,
which is either space-padded or truncated so that its length is
len
.
Mode:
Text
Function frac.f (arg)
Arguments:
arg
A
double
value.
Description: Returns the fractional part of
arg
.
Mode:
Double
Function gamma.f (mu, k, stream)
Arguments:
mu k stream
A
double
value greater than zero specifying the mean.
A
double
value greater than zero specifying the shape.
An
integer
value specifying the random number stream.
Description: Returns a random sample from a gamma distribution.
Mode:
Double
Function hour.f (time)
Arguments:
time
A
double
value specifying a cumulative event time.
Description: Returns the hour portion corresponding to the event time.
Mode:
Integer
Function int.f (arg)
Arguments:
arg
Mode:
A
double
value.
Description: Returns
arg
rounded to the nearest integer.
Integer
Function itoa.f (arg)
103
SIMSCRIPT II.5 User’s Guide
Arguments:
arg
An
integer
value in the range 0 to 9.
Description: Returns an
alpha
value containing the ASCII representation of the given digit.
Mode:
alpha
Function itot.f (arg)
Arguments:
arg
An
integer
value.
Description: Returns a
text
value containing the ASCII representation of the given value.
Mode:
Text
Function length.f (arg)
Arguments:
arg
A
text
value.
Description: Returns the number of characters in
arg
.
Mode:
Integer
Function log.e.f (arg)
Arguments:
arg
A
double
value greater than zero.
Description: Returns the natural logarithm of
arg
.
Mode:
Double
Function log.normal.f (mu, sigma, stream)
Arguments:
mu sigma stream
A
double
value greater than zero specifying the mean.
A
double
value greater than zero specifying the standard deviation.
An
integer
value specifying the random number stream.
Description: Returns a random sample from a log normal distribution.
Mode:
Double
Function log.10.f (arg)
Arguments:
arg
A
double
value greater than zero.
104
Standard SIMSCRIPT II.5 Names
Description: Returns the base 10 logarithm of
arg
.
Mode:
Double
Function lower.f (arg)
Arguments:
arg
A
text
value.
Description: Returns a copy of
arg
with each upper-case character converted to lowercase.
Mode:
Text
Function match.f (string, pattern, offset)
Arguments:
string offset
A
text
value.
pattern
A
text
value.
A non-negative
integer
value.
Description: Returns the position within
string
of the first occurrence of
pattern
, or zero if there is no such occurrence. The search begins after skipping the first
offset
characters of
string.
Mode:
Integer
Function max.f (arg1, arg2, ...)
Arguments:
arg1, arg2, ...
Any combination of two or more
integer
or
double
values.
Description: Returns the maximum of
arg1, arg2, ....
Mode:
Integer
if each of the arguments is
integer
. Otherwise,
double
.
Function min.f (arg1, arg2, ...)
Arguments:
arg1, arg2, ...
Any combination of two or more
integer
or
double
values.
Description: Returns the minimum of
arg1, arg2, ....
Mode:
Integer
if each of the arguments is
integer
. Otherwise,
double
.
Function minute.f (time)
Arguments:
time
A
double
value specifying a cumulative event time.
105
SIMSCRIPT II.5 User’s Guide
Description: Returns the minute portion corresponding to the event time.
Mode:
Integer
Function mod.f (arg1, arg2)
Arguments:
arg1 arg2
An
integer
or
double
value.
An
integer
or
double
value not equal to zero.
Description: Returns a remainder computed as:
Mode:
arg1 - (trunc.f(arg1/arg2) * arg2)
Integer
if both arguments are
integer
. Otherwise,
double
.
Function month.f (time)
Arguments:
time
A
double
value specifying a cumulative simulation time.
Description: Returns the month portion corresponding to the simulation time based on values given to
origin.r
.
Mode:
Integer
Function nday.f (time)
Arguments:
time
A
double
value specifying a cumulative event time.
Description: Returns the day portion corresponding to the event time.
Mode:
Integer
Function normal.f (mu, sigma, stream)
Arguments:
mu sigma
Mode:
A
double
value specifying the mean.
A
double
value greater than zero specifying the standard deviation.
stream
An
integer
value specifying the random number stream.
Description: Returns a random sample from a normal distribution.
Double
Function or.f (arg1, arg2)
Arguments:
arg1 arg2
An
integer
value.
An
integer
value.
106
Standard SIMSCRIPT II.5 Names
Description: Returns the logical sum of
arg1
and
arg2.
Mode:
Integer
Routine origin.r (month, day, year)
Arguments:
month day
An
integer
value specifying the month.
An
integer
value specifying the day within the month.
year
An
integer
value specifying the year.
Description: Defines the calendar date of the start of simulation.
Right function out.f (column)
Arguments:
column
An
integer
value specifying a column position.
Description: Returns the character in the specified column of the current record of the current output unit.
Mode:
Alpha
Left function out.f (column)
Arguments:
column
An
integer
value specifying a column position.
Enter with: An
alpha
value.
Description: Stores the assigned character in the specified column of the current record of the current output unit.
Function poisson.f (mu, stream)
Arguments:
mu
stream
A
double
value greater than zero specifying the mean.
An
integer
value specifying the random number stream.
Description: Returns a random sample from a Poisson distribution.
Mode:
Integer
Function randi.f (low, high, stream)
Arguments:
low high
An
integer
value specifying the beginning value.
An
integer
value specifying the ending value.
stream
An
integer
value specifying the random number stream.
Description: Returns a random sample uniformly distributed between
low
and
high
107
SIMSCRIPT II.5 User’s Guide
Mode: inclusive.
Integer
Function random.f (stream)
Arguments:
stream
An
integer
value specifying the random number stream.
Description: Returns a pseudo-random number between 0 and 1.
Mode:
Double
Function real.f (arg)
Arguments:
arg
An
integer
value.
Description: Returns
arg
as a
double
value.
Mode:
Double
Function ref.f (any)
Arguments:
Description: Indicates an argument to a NONSIMSCRIPT routine is passed by reference.
Mode: n.a
Function repeat.f (txt, count)
Arguments:
txt
count
A
text
value.
A non-negative
integer
value.
text
value which is the concatenation of
count
copies of
txt
.
Mode:
Text
Function sfield.f
Arguments: None
Description: Returns the starting column of the next data field to be read by a free-form
read
statement. Returns zero if there are no more data fields.
Mode:
Integer
Function shl.f (arg1, arg2)
108
Standard SIMSCRIPT II.5 Names
Arguments:
arg1
An
integer
value.
arg2
An
integer
value.
Description: Returns the value of
arg1
shifted left
arg2
bit positions.
Mode:
Integer
Function shr.f (arg1, arg2)
Arguments:
arg1
An
integer
value.
arg2
An
integer
value.
Description: Returns the value of
arg1
shifted right
arg2
bit positions.
Mode:
Integer
Function sign.f (arg)
Arguments:
arg
Mode:
A
double
value.
Description: Returns
+1
if
arg
is positive,
-1
if
arg
is negative, and
0
if
arg
is zero.
Integer
Function sin.f (arg)
Arguments:
arg
A
double
value specifying an angle in radians.
Description: Returns the sine of
arg
.
Mode:
Double
Routine sleep.r (time)
Arguments:
time
A
double
value specifying time in seconds.
Description: Suspends execution of your program for a specified time period. Implemented on VMS platforms only.
Routine snap.r
Arguments: None
Description: User-supplied snapshot routine that is called when a runtime error is detected.
109
SIMSCRIPT II.5 User’s Guide
Function sqrt.f (arg)
Arguments:
arg
A non-negative
double
value.
Description: Returns the square root of
arg
.
Mode:
Double
Right function substr.f (txt, pos, len)
Arguments:
txt pos len
A
text
value.
An
integer
value greater than zero.
A non-negative
integer
value.
Description: Returns the substring of
txt
of length
len
starting at position
pos
.
Mode:
Text
Left function substr.f (txt, pos, len)
Arguments:
txt pos
LEN
A
text
value.
An
integer
value greater than zero.
A non-negative
integer
value.
Enter with: A
text
value.
Description: Replaces the substring of
txt
of length
len
starting at position
pos
with the assigned
text
value.
Routine system.r (command, status)
Arguments:
command
A
text
value specifying command string.
status
An
integer
value specifying VMS return status.
Description: Implemented on VMS platforms only. Executes VMS DCL command.
Function tan.f (arg)
Arguments:
arg
A
double
value specifying an angle in radians.
Description: Returns the tangent of
arg.
110
Standard SIMSCRIPT II.5 Names
Mode:
Double
Function triang.f (min, mu, max, stream)
Arguments:
min mu max stream
A
double
value specifying the minimum.
A
double
value specifying the mean.
A
double
value specifying the maximum.
An
integer
value specifying the random number stream.
Description: Returns a random sample from a triangular distribution.
Mode:
Double
Function trim.f (txt, flag)
Arguments:
txt flag
Mode:
A
text
value.
An
integer
value.
Description: Returns a copy of
txt
which has leading and/or trailing blanks removed. If
flag
≤
0
, leading blanks are removed; if
flag
≥
0
, trailing blanks are removed.
Text
Function trunc.f (arg)
Arguments:
arg
A
double
value.
Description: Returns the truncated value of
arg
.
Mode:
Integer
Function ttoa.f (arg)
Arguments:
arg
A
text
value.
Description: Returns the first character of
arg
.
Mode:
Alpha
Function uniform.f (low, high, stream)
Arguments:
111
SIMSCRIPT II.5 User’s Guide
low high stream
A
double
value specifying the beginning value.
A
double
value specifying the ending value.
An
integer
value specifying the random number stream.
Description: Returns a random sample uniformly-distributed between
low
and
high.
Mode:
Double
Function upper.f (arg)
Arguments:
arg
A
text
value.
Description: Returns a copy of
arg
with each lower-case character converted to uppercase.
Mode:
Text
Function val.f
(any)
Arguments:
Description: Indicates an argument to a FORTRAN routine is passed by value.
Mode: n.a.
Function weekday.f (time)
Arguments:
time
A
double
value specifying a cumulative event time.
Description: Returns the weekday portion corresponding to the event time.
Mode:
Integer
Function weibull.f (shape, scale, stream)
Arguments:
shape scale
A
double
value greater than zero specifying the shape.
A
double
value greater than zero specifying the scale .
stream
An
integer
value specifying the random number stream.
Description: Returns a random sample from a Weibull distribution.
Mode:
Double
Function xor.f (arg1, arg2)
112
Standard SIMSCRIPT II.5 Names
Arguments:
arg1 arg2
An
integer
value.
An
integer
value.
Description: Returns the logical difference of
arg1
and
arg2
.
Mode:
Integer
Function year.f (time)
Arguments:
time
A
double
value specifying a cumulative simulation time.
Description: Returns the year portion corresponding to the simulation time based on values given to
origin.r
.
Mode:
Integer
113
SIMSCRIPT II.5 User’s Guide
C.2 Global Variables
between.v
Description: If non-zero, specifies a routine which is called before each event or process is executed. The default is zero.
Mode:
subprogram buffer.v
Description: Specifies the length of
the buffer
. The default is
132.
Mode:
Integer dir.name.v
Description: Contains the directory the program was run from.
Mode:
Text eof.v
Description: For the current input unit, specifies, the action to take when end-of-file is encountered. If
eof.v
= 0
(the default), the program is aborted with a runtime error. If
eof.v
= 1
, the program is not aborted and
eof.v
is set to
2.
Mode:
Integer event.v
Description: Contains the event/process class of the event or process to occur next.
Mode:
Integer events.v
Description: Contains the number of event/process classes.
Mode:
Integer f.ev.s(i)
Description: Contains the first-in-set pointer of the event set,
ev.s
, for event/process class “
i
”.
Mode:
Pointer heading.v
114
Standard SIMSCRIPT II.5 Names
Description: If non-zero, specifies for the current output unit a page-heading routine which is called for each new page. The default is zero.
Mode:
Subprogram hours.v
Description: Specifies the number of hours per simulated day. The default is
24.0.
Mode:
Double l.ev.s(i)
Description: Contains the last-in-set pointer of the event set,
ev.s
, for event/process class “
i
”.
Mode:
Pointer line.v
Description: Contains, for the current output unit, the line number of the current line within the current page.
Mode:
Integer lines.v
Description: Specifies whether pagination is enabled for the current output unit. If
lines.v
=0
(the default), pagination is disabled. If
lines.v
>0
, pagination is enabled and
lines.v
specifies the number of lines per page.
Mode:
Integer mark.v
Description: Specifies the termination character for external event data and random variable data. The default is “
*
”.
Mode:
Alpha minutes.v
Description: Specifies the number of minutes per simulated hour. The default is
60.0.
Mode:
Double n.ev.s(i)
Description: Contains the number of events or processes of event/process class “
i
” in the event set,
ev.s
.
115
SIMSCRIPT II.5 User’s Guide
Mode
page.v
Description: For the current output unit, contains the page number of the current page.
Mode:
Integer pagecol.v
Description: Specifies for the current output unit whether a line containing the page number should be written automatically as the first line of each page. If
pagecol.v
> 0
, this feature is enabled and
pagecol.v
specifies the starting column of the phrase, “
PAGE nnnn
”. If
pagecol.v
= 0
(the default), this feature is disabled.
Mode:
Integer parm.v(i)
Description: Contains the “
i
”th command-line parameter.
Mode:
Text process.v
Description: If non-zero, contains a pointer to the process notice of the currently-executing process. If zero, no process is executing.
Mode:
Pointer prog.name.v
Description: Contains program name. Any directory information is removed.
Mode:
Text prompt.v
Description: The string of characters to be output when reading an input from terminal.
Default is
Mode:
“”.
Text rcolumn.v
Description: For the current input unit, contains the column number of the last character read from the current record, or zero if no character has been read from the current record.
Mode:
Integer
116
Standard SIMSCRIPT II.5 Names
read.v
Description: Contains the unit number of the current input unit.
Mode:
Integer record.v(i)
Description: Contains the number of records read from or written to unit number “
i
”.
Mode:
Integer ropenerr.v
Description: If non-zero indicates that an error occurred opening the current input unit.
Mode:
Integer rreclen.v
Description: For the current input unit, contains the length of the current record.
Mode:
Integer rrecord.v
Description: Contains the number of records read from the current input unit.
Mode:
Integer seed.v(i)
Description: Contains the seed value used to generate a random number from stream “
i
”.
Mode:
Integer time.v
Description: Contains the current simulated time.
Mode:
Double wcolumn.v
Description: For the current output unit, contains the column number of the last character written to the current record, or zero if no character has been written to the current record.
Mode:
Integer wopenerr.v
117
SIMSCRIPT II.5 User’s Guide
Description: If non-zero indicates that an error occurred opening the current output unit.
Mode:
Integer wrecord.v
Description: Contains the number of records written to the current output unit.
Mode:
Integer write.v
Description: Contains the unit number of the current output unit.
Mode:
Integer
C.3 Attributes
The following attributes are automatically declared for an event or process notice:
eunit.a
Description: Contains zero for an endogenous event. Contains the unit number for an exogenous event.
Mode:
Integer m.ev.s
Description: Contains 1 if the notice is in the event set,
ev.s
. Contains 0 if it is not in the event set.
Mode:
Integer p.ev.s
Description: Contains a pointer to the event set predecessor.
Mode:
Pointer s.ev.s
Description: Contains a pointer to the event set successor.
Mode:
Pointer time.a
Description: Contains the simulated time at which the event or process is to occur, or for an
interrupt
ed process, the amount of time left to
work
or
wait
.
118
Standard SIMSCRIPT II.5 Names
Mode:
Double
The following attributes are automatically declared for a process notice only:
f.rs.s
Description: Contains the first-in-set pointer for the set of resources owned by the process.
Mode:
Pointer ipc.a
Description: Contains the process class corresponding to “
I.process
”.
Mode:
Integer rsa.a
Description: Contains a pointer to the recursive storage save area for a suspended process.
Mode:
Pointer sta.a
Description: Contains the state of the process -
0 if passive (
wait
ing),
1 if active
(
work
ing),
2 if
suspend
ed, or
3 if
interrupt
ed.
Mode:
Integer
C.4 Constants
exp.c
Description: The value of “ e
”,
2.718281828459045.
Mode:
Double inf.c
Description: The largest representable
integer
value.
Mode:
Integer pi.c
Description: The value of pi,
3.141592653589793.
Mode:
Double radian.c
119
SIMSCRIPT II.5 User’s Guide
Description: The number of degrees per radian,
57.29577951308232.
Mode:
Double rinf.c
Description: The largest representable
real
value.
Mode:
Double
120
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 7 PREFACE
- 9 Introduction
- 11 Developing Simulation Models with Simstudio
- 12 Simstudio Overview
- 14 Creating a New Project
- 15 Adding Source code to a Project
- 15 Creating a New File with the Text Editor
- 16 Adding a Directory or a File Using Project Window
- 18 Adding Multiple Directories and Files
- 19 Adding Graphical Elements to a Project
- 20 Opening an Existing Project
- 21 Building a Project
- 22 Building a Project for Debugging
- 24 Building a Project for Release
- 24 Compiler Listings
- 25 Executing a Model
- 25 Passing Command-Line Arguments
- 26 1.6.2 Running the Executable with the Symbolic Debugger
- 27 Closing the Project
- 28 Setting Simstudio Preferences
- 28 On-line Help
- 30 Advanced Compiler/Link Options
- 83 Appendix ACompiler Warning and Error Messages
- 97 Appendix BRuntime Error Messages
- 97 B.1 Runtime Error Messages
- 107 Appendix CStandard SIMSCRIPT II.5 Names
- 107 C.1 Functions and Routines
- 122 C.2 Global Variables
- 126 C.3 Attributes
- 127 C.4 Constants
- 129 Appendix DASCII Character Set