Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- g1 g2 v1 req max cap cost pcap pcost c1 c2 c3 c4
- A 1 -30 10 20 -100 50 NA NA 1 1 NA 0
- A 1 -29 10 20 -100 55 -100 50 1 1 0 0
- A 1 -28 10 20 50 45 -100 55 1 0 0 1
- A 1 -27 10 20 55 51 50 45 1 0 0 1
- A 1 -26 10 20 49 50 55 51 1 1 1 0
- A 1 -25 10 20 49 48 49 50 1 0 0 0
- A 1 -24 10 20 0 37 49 48 1 1 1 0
- A 1 -23 10 20 37 39 0 37 1 1 0 0
- A 1 -22 10 20 45 35 37 39 1 0 0 1
- A 1 -21 10 20 36 32 45 35 1 0 0 0
- A 1 -20 10 20 38 45 36 32 1 1 0 0
- A 1 -19 10 20 -100 50 38 45 1 1 1 0
- A 1 -18 30 20 -100 44 -100 50 0 1 0 0
- for each group(by g1,g2){
- cMax <- ifelse(!c4,pmin(pmax(cap,cost),previous cMax),pmax(cost,previous cMax))
- cMin <- ifelse(!c3,pmax(cap,previous cMin),pmin(cost,previous cMin))
- if(c3 == 1){
- cMin <- ifelse(cMin > cMax, cMax, cMin)
- }
- if(c4 == 1){
- cMax <- ifelse(cMin > cMax, cMin, cMax)
- }
- }
- g1 g2 v1 req max cap cost pcap pcost c1 c2 c3 c4 cMax cMin
- A 1 -30 10 20 -100 50 NA NA 1 1 NA 0 50 NA
- A 1 -29 10 20 -100 55 -100 50 1 1 0 0 50 NA
- A 1 -28 10 20 50 45 -100 55 1 0 0 1 50 45
- A 1 -27 10 20 55 51 50 45 1 0 0 1 51 51
- A 1 -26 10 20 49 50 55 51 1 1 1 0 50 50
- A 1 -25 10 20 49 48 49 50 1 0 0 0 50 48
- A 1 -24 10 20 0 37 49 48 1 1 1 0 37 37
- A 1 -23 10 20 37 39 0 37 1 1 0 0 39 37
- A 1 -22 10 20 45 35 37 39 1 0 0 1 39 35
- A 1 -21 10 20 36 32 45 35 1 0 0 0 36 35
- A 1 -20 10 20 38 45 36 32 1 1 0 0 45 35
- A 1 -19 10 20 -100 50 38 45 1 1 1 0 45 35
- A 1 -18 30 20 -100 44 -100 50 0 1 0 0 44 35
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement