- Added NullPolicyException to scheduler

- Started code for printing the state of the scheduling
- Fixed a bug in the copy constructor of DynamicThread

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@794 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-07-23 22:27:33 +00:00
parent f26b80f76b
commit 6a88e3d85e
13 changed files with 167 additions and 23 deletions

View file

@ -33,7 +33,7 @@ using namespace memory;
using Glib::usleep;
ConcreteSimulation::ConcreteSimulation() :
_state(state_paused), _mode(true), _timer_interval(1000), _policy(NULL)
_state(state_stopped), _mode(true), _timer_interval(1000), _policy(NULL)
{}
void
@ -73,7 +73,7 @@ ConcreteSimulation::stop()
}
void
ConcreteSimulation::run() throw(UserInterruptException)
ConcreteSimulation::run() throw(UserInterruptException, NullPolicyException)
{
switch(_state)
{
@ -117,7 +117,12 @@ ConcreteSimulation::run() throw(UserInterruptException)
try
{
assert(get_policy() != NULL);
if(get_policy() == NULL)
{
stop();
throw NullPolicyException("no policy selected");
}
//step forward
Scheduler::get_instance().step_forward(_history, *get_policy());