Sim::Clock - Simulation clock used by the dispatcher
This document describes Sim::Clock 0.03 released on 2 June, 2007.
use Sim::Clock; my $clock = Sim::Clock->new(0); $clock->push_to(5.6); print $clock->now; # 5.6 $clock->push_to(3); # exception! $clock->reset();
This class offers a simulation clock for Sim::Dispatcher. Basically you needn't create your own clock at all since Sim::Dispatcher always creates one internally and you seldom or never need more than one clock in your simulator. But you really feel the need to do something fancy, simulating quantum mechanics for example, here is the rope.
$obj->new( $init_time ? )
Ths is the constructor for
$init_timeargument specifies the initial time read of the clock and can be omitted.
Reads the current time from the clock.
Push the clock to the specified timestamp
$time, which can't be earlier than the value obtained by the
Resets the clock to time 0.
Agent Zhang <email@example.com>
Copyright 2006 by Agent Zhang. All rights reserved.
This library is free software; you can modify and/or modify it under the same terms as Perl itself.