sim++ spring 95
robert cubert <rmc@cis.ufl.edu>  cis6905 with Dr Paul Fishwick
CISE Dept, Univ of Florida, Gnsvl FL USA
readme for examples/tiktok (formerly ticktock in clock directory in simpack)

-------------------------------------------------------------------------------

                                sim++
                                 |
           +----------+----------+-----------+----------+
           |          |          |           |          |
          doc      include      src         olb      examples
                                                        |
                                             +----------+---------+---...
                                             |          |         |
                                          cpudisk     block     tiktok
                                                                  ^
                                                                  ^
You are here  = = = = = = = = = = = = = = = = = = = = = = = = = = =

-------------------------------------------------------------------------------

This program simulates a clock using discrete event simulation.

-------------------------------------------------------------------------------

tiktok is one of several example programs provided with this release of sim++.
There are several versions of the tiktok program.  The tiktok program was
formerly named "ticktock" in the "clock" directory in simpack.  The users guide
provides information about these various versions and how to use them to help
you learn about sim++.  Each version of the program begins with a brief
description of how it differs from the other versions.

  version 1 = essentially original simpack code, using sim++ cAPI
  version 2 = c++ version using ooAPI
  version 3 = 2 above + semiautomatic style (atomic occurrence/execution)
  version 4 = 2 above + automatic style (atomic occurrence/execution)

Each of the versions above can be translated and run.  There is also a version
numbered 0, which is NOT intended to be translated or run.  Version 0 is the
simpack version of tiktok (except that its name was "ticktock").  It is present
so you can compare it with version 1 to see what exactly had to be changed to
get it to translate without warnings or errors under sim++.

In case you are interested (for example if you are porting code from simpack
to sim++) here are the differences between versions 0 and 1:

    1.  location of queuing.h is now specified by a compiler command line
    switch (in translat and translat.bat) instead of in the source code.
    If queuing.h HAPPENS to be in the right place on your system, you don't
    need to make this change, but i recommend it.

    2.  included <stdio.h>.  Apparently some compilers don't require this.
    Borland Turbo C++ gives an error.  In g++, if you don't include
    stdio.h, you get a warning:  "warning:  implicit declaration of
    function `printf'".  My requirement is that code must compile free of
    warnings or errors.  Hence i included <stdio.h> and recommend you do
    too.  Under g++ your code will compile without making this change, so
    in that environment it's optional.

    3.  added a "return" statement in main().  Without it, Borland compiler
    produces warning:  "Function should return a value in function main()".
    g++ does not complain about the absence of a return statement, but it
    doesn't hurt and is there for warning-free compile under dos.  Your
    code will compile without making this change.

    4.  reduced MAX_TIME from 10000 to 1000, to reduce the quantity of
    output.  Optional change.  Also changed MAX_TIME from a #define to an int
    which is also optional.

    5. Added function prototype declaration for print_time(), and changed
    its return type to void.  Can get around this by defining print_time()
    before main (looks like pascal).

So ALL the changes above have to do with portability between dos and unix, or
the change from c to c++, etc.  NONE has to do with sim++.  And ALL the changes
are, to a degree, optional, depending on your environment and whether warnings
bother you or not.

There's a shell script named "translat" which will translate any of versions 1
thru 4, producing as its output the executable "tiktok", which you may then
run.  "translat" uses a make file whose name is "makefile".

The source code for version 1 is present as file name "tiktok1".  "translat"
copies it to "tiktok.C" before invoking make.  Same idea for versions 2 thru
4.

-------------------------------------------------------------------------------

There are 19 files in this directory.  Here's an annotated list of them:

readme              provides info about the tiktok example program

tiktok0             various versions of source code as explained above
tiktok1
tiktok2
tiktok3
tiktok4

translat            selects and translates a version of the program under unix
makefile

translat.bat        selects and translates a version of program under dos or
                     windows or os2

makefile.simpack    translates the simpack version of cpudisk (version 0)

output.v0u          output files:  the extension is of the form .vix, where
output.v1d           i is the version number 1..4, and x is u for unix or
output.v1u           d for dos
output.v2d
output.v2u
output.v3d
output.v3u
output.v4d
output.v4u

=========================== end readme ========================================

