Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. def method_1(index_1):
  2. if some_condition:
  3. exp_1 = min_num-sum([
  4. variable[(index_1, index_2, index_3)] +
  5. variable[(index_2, index_1, index_3)]
  6. for index_2 in index_set_2
  7. for index_3 in index_set_3
  8. if index_1 != index_2 and
  9. if exp_condition_1 and exp_condition_2
  10. ])
  11. exp_2 = sum([variable[(index_1, index_2, index_3a)] +
  12. variable[(index_2, index_1, index_3a)]
  13. for index_2 in index_set_2
  14. for index_3 in different_index_set_3
  15. if index_1 != index_2 and
  16. if exp_condition_1 and exp_condition_4
  17. ])-max_num
  18. elif some_other_condition:
  19. exp_1 = min_num-sum([
  20. variable[(index_1, index_2, index_3)]
  21. for index_2 in index_set_2
  22. for index_3 in index_set_3
  23. if index_1 != index_2 and
  24. if exp_condition_1 and exp_condition_2
  25. ])
  26. exp_2 = sum([variable[(index_1, index_2, index_3a)]
  27. for index_2 in index_set_2
  28. for index_3 in different_index_set_3
  29. if index_1 != index_2 and
  30. if exp_condition_1 and exp_condition_4
  31. ])-max_num
  32. else:
  33. exp_1 = self.min_num-sum([
  34. variable[(index_2, index_1, index_3)]
  35. for index_2 in different_index_set_2
  36. for index_3 in index_set_3
  37. if index_1 != index_2 and
  38. if exp_condition_1 and exp_condition_5 and exp_condition_6
  39. ])
  40. exp_2 = sum([variable[(index_2, index_1, index_3a)]
  41. for index_2 in index_set_2
  42. for index_3 in different_index_set_3
  43. if index_1 != index_2 and
  44. if exp_condition_1 and exp_condition_5 and exp_condition_6
  45. ])-self.max_num
  46. return [exp_1, exp_2]
  47.  
  48. exp_1 = min_num-term_1
  49. exp_2 = term_2-max_num
  50.  
  51. [some_expression for i in ..... for j in .... for x in ... if (list_of_conditions_depending_on_indexes)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement