%0 Journal Article %T An Optimal Strategy of Resource Sharing in a Case of State-toggling Agents %A Wójtowicz, Tomasz %J Schedae Informaticae %V 2015 %R 10.4467/20838476SI.16.018.4359 %N Volume 24 %P 211-220 %K hard real-time systems, scheduling, shared resource, optimization, round-robin %@ 1732-3916 %D 2016 %U https://ejournals.eu/en/journal/schedae-informaticae/article/an-optimal-strategy-of-resource-sharing-in-a-case-of-state-toggling-agents %X This paper presents an optimal scheduling solution for a case of agents sharing a resource. The amount of resource can not satisfy all agents at once and in case of runout there is a penalty. Each agent randomly toggle its state between requiring and not requiring the resource. Using the knowledge of previous state and probability of change, the scheduling algorithm is able to calculate optimal number of concuring agents for one turn, that minimizes possibility of collision yet provides as much throughput as possible. Several different scheduling strategies are tested. The optimal solution adapts automatically to the value of probability of change. Further experiments show that optimality is retained if only the average probability of a set of agents is known. A case of practical application is provided.