SM::Simulator - Simulator for the SM library
use SM; my $server = new SM::Server(sub { rand(1) }); my $handle; $handle = sub { $server->join_queue(new SM::Client); SM::Simulator->schedule( SM::Simulator->now + rand(2) => $handle ); }; SM::Simulator->schedule( 0.0 => $handle ); SM::Simulator->run(duration => 25.0);
SM::Simulator subclasses the Sim::Dispatcher class and only provides one more subroutine, namely, the log sub.
log
CLASS->log($message)
Logs the message. currently the logger is just stdout.
Agent Zhang <agentzh@gmail.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.
Sim::Dispatcher, SM, SM::Server, SM::Simulator.
To install Sim, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sim
CPAN shell
perl -MCPAN -e shell install Sim
For more information on module installation, please visit the detailed CPAN module installation guide.