src/smt/theory_jobscheduler.cpp
/**
     * check that each job is run on some resource according to 
     * requested capacity.
     * 
     * Check that the sum of jobs run in each time instance
     * does not exceed capacity.
     */
check that each job is run on some resource according to
requested capacity.

Check that the sum of jobs run in each time instance
does not exceed capacity.
check that each job is run on some resource according to requested capacity . Check that the sum of jobs run in each time instance does not exceed capacity .
void theory_jobscheduler::validate_assignment() {
        vector<vector<job_time>> start_times, end_times;
        start_times.reserve(m_resources.size());
        end_times.reserve(m_resources.size());
        for (unsigned j = 0; j < m_jobs.size(); ++j) {
            unsigned r = resource(j);
            start_times[r].push_back(job_time(j, start(j))); 
            end_times[r].push_back(job_time(j, end(j))); 
            if (ect(j, r, start(j)) > end(j)) {
                throw default_exception("job not assigned full capacity");
            }
            unsigned idx;
            if (!resource_available(r, start(j), idx)) {
                throw default_exception("resource is not available at job start time");
            }
        }
        for (unsigned r = 0; r < m_resources.size(); ++r) {
            job_overlap overlap(start_times[r], end_times[r]);
            while (overlap.next()) {
                unsigned cap = 0;
                for (auto j : overlap.jobs()) {
                    cap += get_job_resource(j, r).m_loadpct;
                }
                if (cap > 100) {
                    throw default_exception("capacity on resource exceeded");
                }
            }
        }
    }
void theory_jobscheduler :: validate_assignment ( ) { vector < vector < job_time > > start_times , end_times ; start_times . reserve ( m_resources . size ( ) ) ; end_times . reserve ( m_resources . size ( ) ) ; for ( unsigned j = 0 ; j < m_jobs . size ( ) ; ++ j ) { unsigned r = resource ( j ) ; start_times [ r ] . push_back ( job_time ( j , start ( j ) ) ) ; end_times [ r ] . push_back ( job_time ( j , end ( j ) ) ) ; if ( ect ( j , r , start ( j ) ) > end ( j ) ) { throw default_exception ( " " ) ; } unsigned idx ; if ( ! resource_available ( r , start ( j ) , idx ) ) { throw default_exception ( " " ) ; } } for ( unsigned r = 0 ; r < m_resources . size ( ) ; ++ r ) { job_overlap overlap ( start_times [ r ] , end_times [ r ] ) ; while ( overlap . next ( ) ) { unsigned cap = 0 ; for ( auto j : overlap . jobs ( ) ) { cap += get_job_resource ( j , r ) . m_loadpct ; } if ( cap > 100 ) { throw default_exception ( " " ) ; } } } }
check that each job is run on some resource according to
 requested capacity.
check that each job is run on some resource according to requested capacity .
// order jobs running on r by start, end-time intervals // then consume ordered list to find jobs in scope. // check that sum of job loads does not exceed 100%