Job Priorities

I have some finite vehicle with different priorities jobs. I tried to follow the approach what you mentioned here:

But faced the problem what you mentioned here. As I have finite fleet some of jobs are being unassigned which have more priority than others. How to assign all the jobs having more priority before the others?

Do you use your own objective function? Note that priority = 1 means high priority whereas priority = 3 means low priority.

Hi Steafan,

Here is my objective function. Please suggest me what I am doing wrong here.

HardActivityConstraint specificVehicle = new HardActivityConstraint() {

@Override
public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct,
                                   TourActivity nextAct, double prevActDepTime) {
    if(newAct instanceof TourActivity.JobActivity) {
        if(prevAct instanceof TourActivity.JobActivity) {
            if(((TourActivity.JobActivity) newAct).getJob().getPriority() < ((TourActivity.JobActivity) prevAct).getJob().getPriority()){
                return ConstraintsStatus.NOT_FULFILLED;
            }
        }
        if(nextAct instanceof TourActivity.JobActivity) {
            if(((TourActivity.JobActivity) newAct).getJob().getPriority() > ((TourActivity.JobActivity) nextAct).getJob().getPriority()){
                return ConstraintsStatus.NOT_FULFILLED;
            }
        }
        return ConstraintsStatus.FULFILLED;
    }
    return ConstraintsStatus.FULFILLED;
}

};