@Test public void testOrderNoGap() throws PlanningException { prepareBasicPlan(); ReservationDefinition rr = new ReservationDefinitionPBImpl(); rr.setArrival(0 * step); rr.setDeadline(60 * step); ReservationRequests reqs = new ReservationRequestsPBImpl(); reqs.setInterpreter(ReservationRequestInterpreter.R_ORDER_NO_GAP); ReservationRequest r = ReservationRequest.newInstance( Resource.newInstance(2048, 2, 2), 10, 1, 10 * step); ReservationRequest r2 = ReservationRequest.newInstance( Resource.newInstance(1024, 1, 1), 10, 10, 20 * step); List<ReservationRequest> list = new ArrayList<ReservationRequest>(); list.add(r); list.add(r2); list.add(r); list.add(r2); reqs.setReservationResources(list); rr.setReservationRequests(reqs); rr.setReservationRequests(reqs); ReservationId reservationID = ReservationSystemTestUtil .getNewReservationId(); agent.createReservation(reservationID, "u1", plan, rr); System.out.println("--------AFTER ORDER ALLOCATION (queue: " + reservationID + ")----------"); System.out.println(plan.toString()); System.out.println(plan.toCumulativeString()); assertTrue("Agent-based allocation failed", reservationID != null); assertTrue("Agent-based allocation failed", plan.getAllReservations() .size() == 3); ReservationAllocation cs = plan.getReservationById(reservationID); assertTrue(cs.toString(), check(cs, 0 * step, 10 * step, 20, 1024, 1)); assertTrue(cs.toString(), check(cs, 10 * step, 30 * step, 10, 1024, 1)); assertTrue(cs.toString(), check(cs, 30 * step, 40 * step, 20, 1024, 1)); assertTrue(cs.toString(), check(cs, 40 * step, 60 * step, 10, 1024, 1)); }
@Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }
GreedyReservationAgent implements ReservationAgent { @Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); } }
GreedyReservationAgent implements ReservationAgent { @Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }  }
GreedyReservationAgent implements ReservationAgent { @Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }  @Override boolean createReservation(ReservationId reservationId, String user,
      Plan plan, ReservationDefinition contract); @Override boolean updateReservation(ReservationId reservationId, String user,
      Plan plan, ReservationDefinition contract); @Override boolean deleteReservation(ReservationId reservationId, String user,
      Plan plan); }
GreedyReservationAgent implements ReservationAgent { @Override public boolean createReservation(ReservationId reservationId, String user, Plan plan, ReservationDefinition contract) throws PlanningException { return computeAllocation(reservationId, user, plan, contract, null); }  @Override boolean createReservation(ReservationId reservationId, String user,
      Plan plan, ReservationDefinition contract); @Override boolean updateReservation(ReservationId reservationId, String user,
      Plan plan, ReservationDefinition contract); @Override boolean deleteReservation(ReservationId reservationId, String user,
      Plan plan);  }