|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.shirako.time.calendar.BaseCalendar
orca.shirako.time.calendar.ClientCalendar
orca.shirako.time.calendar.BrokerCalendar
public class BrokerCalendar
An AgentCalendaris used to organize reservation information
for an agent. It builds on the functionality provided by
ClientCalendar and extends it with the following features:
SourceCalendar for each source reservation used to
allocate resources.
| Field Summary | |
|---|---|
protected ReservationList |
closing
List of reservations grouped by closing time |
protected ReservationList |
requests
Reservation requests grouped by start cycle |
protected java.util.HashMap<ReservationID,SourceCalendar> |
sources
Source reservation calendars indexed by the source reservation identifier |
| Fields inherited from class orca.shirako.time.calendar.ClientCalendar |
|---|
demand, holdings, pending, renewing |
| Fields inherited from class orca.shirako.time.calendar.BaseCalendar |
|---|
clock |
| Constructor Summary | |
|---|---|
BrokerCalendar(ActorClock clock)
|
|
| Method Summary | |
|---|---|
void |
addClosing(ResourceReservation reservation,
long cycle)
Add a reservation to be closed on the given cycle |
void |
addOutlay(ResourceReservation source,
ResourceReservation client,
long start,
long end)
Add outlay reservation |
void |
addRequest(BrokerReservation reservation,
long cycle)
Add a client request |
void |
addRequest(ResourceReservation reservation,
long cycle,
ResourceReservation source)
Add an extending reservation |
void |
addSource(ReservationClient source)
Add a source reservation. |
ReservationSet |
getClosing(long cycle)
Obtain all reservations that need to be closed on the given cycle |
ReservationSet |
getOutlays(ResourceReservation source)
Obtain the client reservations satisfied from the given source reservation |
ReservationSet |
getOutlays(ResourceReservation source,
long cycle)
Obtain the client reservations satisfied from the given source that are active at the specified cycle. |
ReservationSet |
getRequests(long cycle)
Obtain all client requests for the given cycle |
ReservationSet |
getRequests(ResourceReservation source,
long cycle)
Obtain the extending requests for the given source reservation |
void |
remove(ResourceReservation reservation)
Removes the specified reservation from all internal calendar data structures. |
void |
removeClosing(ResourceReservation reservation)
Remove the given reservation from the list of closing reservations. |
void |
removeClosing(ResourceReservation reservation,
long cycle)
Remove the given reservation from the list of closing reservations on the given cycle. |
void |
removeOutlay(ResourceReservation source,
ResourceReservation client)
Removes an outlay reservation |
void |
removeRequest(BrokerReservation reservation)
|
void |
removeRequest(BrokerReservation reservation,
long cycle)
|
void |
removeRequest(ResourceReservation source,
BrokerReservation request)
|
void |
removeRequest(ResourceReservation source,
ResourceReservation request,
long cycle)
|
void |
removeScheduledOrInProgress(ResourceReservation reservation)
Removes the specified reservations from all internal calendar data structures that represent operations to be scheduled in the future or operations that are currently in progress. |
void |
removeSourceCalendar(ResourceReservation source)
Removes any data structures associated with a source reservation. |
void |
tick(long cycle)
Perform calendar cleanup |
| Methods inherited from class orca.shirako.time.calendar.ClientCalendar |
|---|
addDemand, addHolding, addPending, addRenewing, getDemand, getHoldings, getHoldings, getHoldings, getPending, getRenewing, removeDemand, removeHolding, removePending, removeRenewing, removeRenewing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ReservationList closing
protected ReservationList requests
protected java.util.HashMap<ReservationID,SourceCalendar> sources
| Constructor Detail |
|---|
public BrokerCalendar(ActorClock clock)
| Method Detail |
|---|
public void remove(ResourceReservation reservation)
ClientCalendar
remove in class ClientCalendarreservation - reservation to removepublic void removeScheduledOrInProgress(ResourceReservation reservation)
ClientCalendar
removeScheduledOrInProgress in class ClientCalendarpublic ReservationSet getRequests(long cycle)
cycle -
public void addRequest(BrokerReservation reservation,
long cycle)
reservation - cycle -
public void addRequest(ResourceReservation reservation,
long cycle,
ResourceReservation source)
reservation - The reservationcycle - The desired start cyclesource - The source reservation
public ReservationSet getRequests(ResourceReservation source,
long cycle)
source - cycle -
public void removeRequest(BrokerReservation reservation)
public void removeRequest(BrokerReservation reservation,
long cycle)
public void removeRequest(ResourceReservation source,
ResourceReservation request,
long cycle)
public void removeRequest(ResourceReservation source,
BrokerReservation request)
public void addOutlay(ResourceReservation source,
ResourceReservation client,
long start,
long end)
source - The source reservationclient - The client reservation satisfied from the given source
reservationstart - end -
public void removeOutlay(ResourceReservation source,
ResourceReservation client)
source - The source reservationclient - The client reservation satisfied from the given sourcepublic void addSource(ReservationClient source)
source - public void removeSourceCalendar(ResourceReservation source)
source - source reservationpublic ReservationSet getOutlays(ResourceReservation source)
source - The source reservation
public ReservationSet getOutlays(ResourceReservation source,
long cycle)
source - The source reservationcycle -
public ReservationSet getClosing(long cycle)
cycle - The cycle
public void addClosing(ResourceReservation reservation,
long cycle)
reservation - The reservationcycle - The cycle
public void removeClosing(ResourceReservation reservation,
long cycle)
reservation - The reservationcycle - The cyclepublic void removeClosing(ResourceReservation reservation)
reservation - The reservationpublic void tick(long cycle)
BaseCalendar
tick in class ClientCalendar
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||