- fixed a number of bugs

- added dummy_policy written in C++
- the interpreter is now finished (hopefully)


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@366 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
fpaparel 2006-02-21 11:09:55 +00:00
parent ea70e2f092
commit 4482b98df7
17 changed files with 230 additions and 106 deletions

View file

@ -25,7 +25,7 @@ using namespace sgpem;
using namespace memory;
using Glib::usleep;
Simulation::Simulation(): _state(state_paused), _mode(false), _timer_interval(1000)
Simulation::Simulation(): _state(state_paused), _mode(true), _timer_interval(1000)
{
}
@ -83,16 +83,17 @@ Simulation::run()
_state = state_running;
//******* CONTINUOUS TIME
if (_mode)
{
loop:
loop:
// chech for termination
bool all_term = true;
smart_ptr<const SchedulableList> left = h.get_simulation_status_at(h.get_current_time());
smart_ptr<SchedulableList> left = h.get_simulation_status_at(h.get_current_time());
for(uint i = 0; i < left->size(); i++)
if (left->get_item_at(i)->get_state() != SchedulableStatus::state_terminated)
{
all_term = true;
all_term = false;
break;
}
@ -119,14 +120,14 @@ Simulation::run()
//******* STEP by STEP
else
{
{
// chech for termination
bool all_term = true;
smart_ptr<const SchedulableList> left = h.get_simulation_status_at(h.get_current_time());
smart_ptr<SchedulableList> left = h.get_simulation_status_at(h.get_current_time());
for(uint i = 0; i < left->size(); i++)
if (left->get_item_at(i)->get_state() != SchedulableStatus::state_terminated)
{
all_term = true;
all_term = false;
break;
}
@ -178,4 +179,3 @@ Simulation::get_avaiable_policies()
v.push_back(Scheduler::get_instance().get_policy());
return v;
}