hi list
i am developping a scheduling algorithm usig boost graph library.
I want to update the list of the ready tasks. for that , i develop a
function
template file://this tests if all parent of
vertex v are scheduled
// i.e v is a ready task
bool isReady(const Vertex v,const Graph g){
typedef typename property_map::const_type
NamePA;
NamePA name = get(vertex_first_name, g);
typedef typename boost::property_traits<NamePA>::value_type NameType;
// typename boost::property_map::type id =
get(vertex_index, g);
NameType src_name;
boost::graph_traits<Graph>::vertex_iterator vi;
for (vi=in_edges(v,g).first; // XXXXXXXX
vi!=in_edges(v,g);
++vi){
/// if (name[*vi]==false) return false;
}
return true;
}
and I call it from
template <class Graph>
void allocate1(Graph &g,vector<MACHINE> &m){
typedef typename property_map::type NamePA;
NamePA name = get(vertex_first_name, g);
typedef typename boost::property_traits<NamePA>::value_type NameType;
typename boost::property_map::type id =
get(vertex_index, g);
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex;
NameType src_name;
boost::graph_traits<Graph>::vertex_iterator vi;
typedef list<vertex> vlist;
vlist readyTasks;
cerr << "Machine number :" << m.size() << endl;
///////////// initialising the ready tasks list
for (vi=vertices(g).first;vi!=vertices(g).second;++vi){
if (in_degree(*vi,g)==0)
readyTasks.push_back(*vi);
cerr << "pushing vertex "<(temp,g)==true) {
readyTasks.push_back(*vi);
cerr << "pushing vertex "<