Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def method_1(index_1):
- if some_condition:
- exp_1 = min_num-sum([
- variable[(index_1, index_2, index_3)] +
- variable[(index_2, index_1, index_3)]
- for index_2 in index_set_2
- for index_3 in index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_2
- ])
- exp_2 = sum([variable[(index_1, index_2, index_3a)] +
- variable[(index_2, index_1, index_3a)]
- for index_2 in index_set_2
- for index_3 in different_index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_4
- ])-max_num
- elif some_other_condition:
- exp_1 = min_num-sum([
- variable[(index_1, index_2, index_3)]
- for index_2 in index_set_2
- for index_3 in index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_2
- ])
- exp_2 = sum([variable[(index_1, index_2, index_3a)]
- for index_2 in index_set_2
- for index_3 in different_index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_4
- ])-max_num
- else:
- exp_1 = self.min_num-sum([
- variable[(index_2, index_1, index_3)]
- for index_2 in different_index_set_2
- for index_3 in index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_5 and exp_condition_6
- ])
- exp_2 = sum([variable[(index_2, index_1, index_3a)]
- for index_2 in index_set_2
- for index_3 in different_index_set_3
- if index_1 != index_2 and
- if exp_condition_1 and exp_condition_5 and exp_condition_6
- ])-self.max_num
- return [exp_1, exp_2]
- exp_1 = min_num-term_1
- exp_2 = term_2-max_num
- [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