Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Homogeneous ordering method
  2. ===========================
  3. - We assume we have the list of campaigns (ordered by leads size) [{camp1: [listOfLeads]}, {camp2: [listOfLeads]}, ...]
  4. - We take the 2 first campaigns and compare the leads size to get the difference, then we save the difference (leads) in another variable. camp1 has 250, camp2 has 230, remainingLeads = 20 remaining leads. That way, we have camp1 and camp2 with 230 leads each.
  5. - We zip camp1 and camp2 leads and push them to a variable. result = zip(camp1.listOfLeads, camp2.listOfLeads)
  6. - We divide the result variable length by the remainingLeads to get a step to push the remaining leads. step = result/remainingLeads ; 460/20 = 23
  7. - We push the 20 remaining leads each 23 items
  8. - We start over again for the rest of the campaigns. The next comparison will not compare camp1, but the result variable with camp3
  9.  
  10. Considerations:
  11. - If camp1 has the double or more leads than camp2, we divide the length to get the step value (round to floor) and push to the result variable (example: 24038(camp1)/11543(camp2) = 2.08247(step); 2(roundStep))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement