Example #1
0
def type2(era1,era2):
    a12_o1 = a12(calc_obj1(era1),calc_obj1(era2))
    a12_o2 = a12(calc_obj2(era1),calc_obj2(era2))
    if a12_o1 >=0.56 or a12_o2>0.56:
        return 5
    else:
        # print a12_o1,a12_o2
        return -1
Example #2
0
	def type2_comparison(self, current_era, previous_era):
		curr_era_objectives = self.get_objectives_list(current_era)
		prev_era_objectives = self.get_objectives_list(previous_era)
		# print sk.a12(curr_era_objectives, prev_era_objectives)
		if (sk.a12(curr_era_objectives, prev_era_objectives) > 0.56):
			return 5
		return -1
Example #3
0
 def type2_comparison(self, current_era, previous_era):
     curr_era_objectives = self.get_objectives_list(current_era)
     prev_era_objectives = self.get_objectives_list(previous_era)
     # print sk.a12(curr_era_objectives, prev_era_objectives)
     if (sk.a12(curr_era_objectives, prev_era_objectives) > 0.56):
         return 5
     return -1
Example #4
0
def type2(era_one, era_two, model):
    for objective in model.get_objectives():
        era_one_objective = []
        era_two_objective = []
        for i in xrange(0, len(era_one)):
            era_one_objective.append(objective(era_one[i]))
            era_two_objective.append(objective(era_two[i]))
        if (a12(era_one_objective, era_two_objective) > 0.56):
            return 5
    return -1
    def type2(era_one, era_two, model):
        for objective in model.get_objectives():
            era_one_objective = []
            era_two_objective = []
            for i in xrange(0, len(era_one)):
                era_one_objective.append(objective(era_one[i]))
                era_two_objective.append(objective(era_two[i]))
            if (a12(era_one_objective, era_two_objective) > 0.56):
                return 5

        return -1
Example #6
0
 def calc_a12(self):
     if self.current_generation % 100 != 99 or self.current_generation < 199:
         return 0
     gen1 = []
     gen2 = []
     for i in range(self.current_generation-199, self.current_generation-99):
         gen1 += self.generations[i].candidates
     for i in range(self.current_generation-99, self.current_generation+1):
         gen2 += self.generations[i].candidates
     sum1 = [sum(c.fitness) for c in gen1]
     sum2 = [sum(c.fitness) for c in gen2]
     a12 = sk.a12(sum1, sum2)
     return 1 if a12 > 0.56 else 0
Example #7
0
 def penalize_lives(self):
     """
     Type II comparison
     Compares between current frontier and the previous frontier
     if atleast one is better in the current frontier - dont penalize
     """
     for i in xrange(0,model.num_objectives):
         era_old=[]
         era_new=[]
         for j in xrange(0,len(self.frontier_new)):
             era_old.append(self.frontier[j][i])
             era_new.append(self.frontier_new[j][i])
         if (a12(era_new, era_old) > 0.4):
             return 5
     return -1    
def type2(list1, list2):

    if (sk.a12(list1, list2) <= 0.56):
        return -1
    else:
        return 5
Example #9
0
def type2(model1,model2):
    if (sk.a12(model1,model2) <= 0.6):
        return -1
    else:
        return 5
Example #10
0
def type2(prev_era,curr_era):
  improvement = a12(curr_era,prev_era)
  if improvement > 0.5:
    return 5
  else:
    return -1
Example #11
0
 def same(): return a12(new, old)<=0.56
 if self.less: