Initial commit
This commit is contained in:
35
calendar.py
Normal file
35
calendar.py
Normal file
@@ -0,0 +1,35 @@
|
||||
class Timeslot:
|
||||
def __init__(self, ut_start, duration):
|
||||
self.ut_start = ut_start
|
||||
self.duration = duration
|
||||
|
||||
@property
|
||||
def ut_end(self):
|
||||
return self.ut_start + self.duration
|
||||
|
||||
@ut_end.setter
|
||||
def ut_end(self, value):
|
||||
self.duration = self.value - self.start
|
||||
|
||||
|
||||
class Calendar:
|
||||
def create_reservation(self, ut_start, duration, maneuver):
|
||||
if not self.timeslot_is_free(ut_start, duration):
|
||||
raise
|
||||
pass
|
||||
|
||||
def timeslot_is_free(self, ut_start: int, duration: int) -> bool:
|
||||
pass
|
||||
|
||||
def next_free_timeslot(self, from_ut, duration=None) -> int:
|
||||
pass
|
||||
|
||||
def get_reservation(self, ut_at) -> Timeslot:
|
||||
pass
|
||||
|
||||
def delete_reservation(self, ut_at, priority):
|
||||
reservation = self.get_re(ut_at)
|
||||
if priority <= reservation.priority:
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user