pub struct ReservationManager {
pub enabled: bool,
/* private fields */
}Expand description
Manages time-windowed reservations for edges and nodes
Allows robots to reserve resources for specific time windows, enabling proactive conflict detection and prevention.
Fields§
§enabled: boolWhether reservation system is enabled
Implementations§
Source§impl ReservationManager
impl ReservationManager
Sourcepub fn new_enabled() -> Self
pub fn new_enabled() -> Self
Create a new enabled reservation manager
Sourcepub fn can_reserve(
&self,
resource: &ReservableResource,
robot: RobotId,
start: SimTime,
end: SimTime,
) -> bool
pub fn can_reserve( &self, resource: &ReservableResource, robot: RobotId, start: SimTime, end: SimTime, ) -> bool
Check if a resource can be reserved for a time window
Returns true if no conflicting reservations exist, or if the reservation system is disabled.
Sourcepub fn reserve(
&mut self,
resource: ReservableResource,
robot: RobotId,
start: SimTime,
end: SimTime,
) -> Result<(), ReservationConflict>
pub fn reserve( &mut self, resource: ReservableResource, robot: RobotId, start: SimTime, end: SimTime, ) -> Result<(), ReservationConflict>
Reserve a resource for a time window
Returns Ok(()) if the reservation was successful, or an error describing the conflict if another robot has a conflicting reservation.
Sourcepub fn release_all(&mut self, robot: RobotId)
pub fn release_all(&mut self, robot: RobotId)
Release all reservations for a robot
Called when a robot completes its task or aborts.
Sourcepub fn release(&mut self, resource: &ReservableResource, robot: RobotId)
pub fn release(&mut self, resource: &ReservableResource, robot: RobotId)
Release reservations for a robot on a specific resource
Sourcepub fn cleanup_expired(&mut self, current_time: SimTime)
pub fn cleanup_expired(&mut self, current_time: SimTime)
Clean up expired reservations (those that ended before current_time)
Should be called periodically to prevent memory growth.
Sourcepub fn get_conflicts(
&self,
resource: &ReservableResource,
robot: RobotId,
start: SimTime,
end: SimTime,
) -> Vec<&Reservation>
pub fn get_conflicts( &self, resource: &ReservableResource, robot: RobotId, start: SimTime, end: SimTime, ) -> Vec<&Reservation>
Get all conflicts for a proposed reservation
Returns a list of reservations that would conflict with the proposed reservation window.
Sourcepub fn get_robot_reservations(&self, robot: RobotId) -> Vec<&Reservation>
pub fn get_robot_reservations(&self, robot: RobotId) -> Vec<&Reservation>
Get all reservations for a specific robot
Sourcepub fn reservation_count(&self) -> usize
pub fn reservation_count(&self) -> usize
Get the number of active reservations
Sourcepub fn has_reservations(
&self,
resource: &ReservableResource,
start: SimTime,
end: SimTime,
) -> bool
pub fn has_reservations( &self, resource: &ReservableResource, start: SimTime, end: SimTime, ) -> bool
Check if a resource has any reservations in a time window
Trait Implementations§
Source§impl Clone for ReservationManager
impl Clone for ReservationManager
Source§fn clone(&self) -> ReservationManager
fn clone(&self) -> ReservationManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ReservationManager
impl Default for ReservationManager
Source§fn default() -> ReservationManager
fn default() -> ReservationManager
Auto Trait Implementations§
impl Freeze for ReservationManager
impl RefUnwindSafe for ReservationManager
impl Send for ReservationManager
impl Sync for ReservationManager
impl Unpin for ReservationManager
impl UnwindSafe for ReservationManager
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.