- 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

@ -34,9 +34,13 @@
#include "backend/process.hh"
#include "backend/policy.hh"
#include "backend/policy_parameters.hh"
#include "backend/python_policy.hh"
#include "backend/python_policy_manager.hh"
#include "standard_io.hh"
#include "text_simulation.hh"
#include "backend/dummy_policy.hh"
#include <glibmm/ustring.h>
#include <iostream>
@ -72,32 +76,55 @@ main(int argc, char* argv[])
filenames.insert(filenames.begin(), a_ptr, a_ptr+a_count);
}
*/
// Set the unique POLICY
DummyPolicy pol;
pol.configure();
pol.get_parameters().set_int("var2", 33);
pol.get_parameters().set_float("multiplier", 100);
pol.get_parameters().set_string("che_ne_so", "ciao");
Scheduler::get_instance().set_policy(&pol);
TextSimulation text_sim;
History::get_instance().attach(&text_sim);
//textual IO
smart_ptr<IOManager> io(new StandardIO());
text_sim.add_io_device(io);
//grafical IO
start_gui(argc, argv);
//SMOKE-TEST for backend classes
/* cout << "\n\n********************************";
Process p1("P1", 0,10,1);
Process p2("P2", 0,30,2);
Process p3("P3", 5,15,3);
Process p4("P4", 6,5,3);
Process p5("P5", 1,10,3);
// Create an INITIAL STATE
Process p1("P1", 0,5,1);
Process p2("P2", 0,5,2);
Process p3("P3", 5,3,3);
Process p4("P4", 6,2,3);
Process p5("P5", 1,2,3);
Process p6("P6", 10,2,1);
SchedulableStatus ss1(p1); ss1.set_state(SchedulableStatus::state_running);
SchedulableStatus ss1(p1);
SchedulableStatus ss2(p2);
SchedulableStatus ss3(p3);
SchedulableStatus ss4(p4); ss4.set_state(SchedulableStatus::state_running);
SchedulableStatus ss4(p4);
SchedulableStatus ss5(p5);
SchedulableStatus ss6(p6);
// SimulationStatus sim1; sim1.set_running(p1);
SchedulableList initial;
initial.add_at_bottom(ss1);
initial.add_at_bottom(ss2);
initial.add_at_bottom(ss3);
initial.add_at_bottom(ss4);
initial.add_at_bottom(ss5);
initial.add_at_bottom(ss6);
History::get_instance().enqueue_slice(initial);
//grafical IO
start_gui(argc, argv);
//SMOKE-TEST for backend classes
/* cout << "\n\n********************************";
//************** TEST HISTORY
@ -170,4 +197,3 @@ main(int argc, char* argv[])
*/
return 0;
}