new method checkIfResourceCanPreempt added to objectResource. The method will...

new method checkIfResourceCanPreempt added to objectResource. The method will check weather the object currently occupying the resource can be preempted and if there is need will eventually preempt the object.
parent ea60e1af
...@@ -48,6 +48,13 @@ class ObjectResource(object): ...@@ -48,6 +48,13 @@ class ObjectResource(object):
def checkIfResourceIsAvailable(self,callerObject=None): def checkIfResourceIsAvailable(self,callerObject=None):
return len(self.Res.activeQ)<self.capacity return len(self.Res.activeQ)<self.capacity
# =======================================================================
# Check if Operator Can perform a preemption
# =======================================================================
def checkIfResourceCanPreempt(self,callerObject=None):
# TODO: each resource will return according to its availability for preemption
return False
# ======================================================================= # =======================================================================
# actions to be taken after the simulation ends # actions to be taken after the simulation ends
# ======================================================================= # =======================================================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment