Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ( child in children ) {
- if ( child.dataLoad > avg + 1 ) {
- foreach ( child2 in children ) {
- if ( child != child2 && child2.dataLoad < avg ) {
- sendLoad(child, child2)
- }
- }
- }
- }
- for each child in list {
- if child2 == nil then assert("Error in logic");
- while child.workload > avg + 1 {
- sendwork(child, child2, min(avg + 1 - child2.workload, child.workload - (avg + 1)))
- if child2.workload == avg + 1 then child2 = child2.next;
- }
- }
Add Comment
Please, Sign In to add comment