In an assignment for uni , I've been asked to create a schedule for hypothetical backup represented by the predicate backup/5
- The first argument is the server type with values : db , web
- The second argument is the server name
- the third argument represents the time the backup can start at
- the fourth argument represents the duration of the backup
- The fifth argument represents the bandwidth required for the backup
Constraints:
- 2 instances of db or web back ups cannot be runniong at the same time(1 of each at the same time could be done).
- Total bandwidth cannot be more than 25
What needs to be done is to write a predicate schedule_backups(Db_Starts,Web_Starts,ToalTime). libraries that can be used ic,ic_global,branch_and_bound,ic_edge_finder.
examples for backups :
backup(db,srv_d1,0,5,10).
backup(db,srv_d2,2,8,18).
backup(db,srv_d3,0,4,11).
backup(web,srv_w1,0,7,8).
backup(web,srv_w2,3,11,10).
The question is ... How do I get the bandwidth constraint on all the backups while having to constraint them seperatly for the start time constraint? I figured it out and have a working piece of code , but I do not think that it is the best way to do it. I will post it as the solution.
If anybody has something better as a suggestion feel free to post.