Exemple #1
0
 def __init__(prob):
     prob.name = "Osyczka2"
     lows = [0, 0, 1, 1, 0, 0]
     ups = [10, 10, 5, 5, 6, 10]
     names = ["x1", "x2", "x3", "x4", "x5", "x6"]
     prob.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(6)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #2
0
    def __init__(prob):

        super(zdt1, prob).__init__()
        prob.name = "ZDT1"
        names = ["x" + str(i+1) for i in range(30)]
        prob.decisions = [jmoo_decision(names[i], 0, 1) for i in range(len(names))]
        prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #3
0
 def __init__(prob):
     prob.name = "ZDT4"
     names = ["x" + str(i+1) for i in range(10)]
     prob.decisions = [jmoo_decision(names[i], -5, 5) for i in range(len(names))]
     prob.decisions[0].low = 0
     prob.decisions[0].up = 1
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #4
0
 def __init__(self, requirements, releases, clients, density, budget):
     self.name = "NRP_" + str(requirements) + "_" + str(releases) + "_" + str(clients) + "_" +str(density) \
                 + "_" + str(budget)
     names = ["x" + str(i + 1) for i in range(requirements)]  # |x_i + y_i|
     lows = [-1 for i in xrange(requirements)]
     ups = [(releases - 1) for _ in xrange(requirements)]
     self.decisions = [
         jmoo_decision(names[i], lows[i], ups[i])
         for i in range(requirements)
     ]
     self.objectives = [
         jmoo_objective("f1", False),
         jmoo_objective("f2", True),
         jmoo_objective("f3", False)
     ]
     self.trequirements = requirements
     self.treleases = releases
     self.tclients = clients
     self.tdensity = density
     self.tbudget = budget
     self.requirement = None
     self.client = None
     self.release = None
     self.precedence = []
     self.generate_data()
Exemple #5
0
 def __init__(prob):
     prob.name = "POM3MIN"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency", "Dynamism", "Size", "Plan", "Team Size"]
     LOWS = [0.80, 1.22, 2, 0.60, 0,  1, 0, 0, 1]
     UPS  = [0.90, 1.62, 6, 0.62, 2, 3, 1, 1, 3]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     prob.objectives = [jmoo_objective("Cost", True), jmoo_objective("Score", False), jmoo_objective("Completion", False), jmoo_objective("Idle", True)]
Exemple #6
0
 def __init__(prob):
     prob.name = "ScaleTestDissimilar"
     prob.decisions = [jmoo_decision("x1", 0, 1), jmoo_decision("x2", 0, 1)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #7
0
 def __init__(prob):
     prob.name = "Golinski"
     names = ["x1", "x2", "x3", "x4", "x5", "x6", "x7"]
     LOWS = [2.6, 0.7, 17.0, 7.3, 7.3, 2.9, 5.0]
     UPS = [3.6, 0.8, 28.0, 8.3, 8.3, 3.9, 5.5]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(7)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #8
0
 def __init__(prob, n):
     prob.evals = 0
     prob.name = "Fonseca"
     names = ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"]
     n = max(min(8, n), 1) #constrain n to its range
     prob.decisions = [jmoo_decision("x" + str(i+1), -2, 2) for i in range(n)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #9
0
 def __init__(prob):
     prob.name = "POM3Asanscomp"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency", "Dynamism", "Size", "Plan", "Team Size"]
     LOWS = [0.1, 0.82, 2,  0.40, 1,   1,  0, 0, 1]
     UPS  = [0.9, 1.20, 10, 0.70, 100, 50, 4, 5, 44]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     prob.objectives = [jmoo_objective("Cost", True, 0), jmoo_objective("Score", False, 0, 1), jmoo_objective("Idle", True, 0, 1)]
Exemple #10
0
 def __init__(prob):
     prob.name = "POM3D"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency", "Dynamism", "Size", "Plan", "Team Size"]
     LOWS = [0.10, 0.82, 2, 0.60, 80,  1, 0, 0, 10]
     UPS  = [0.20, 1.26, 8, 0.95, 100, 10, 2, 5, 20]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     prob.objectives = [jmoo_objective("Cost", True, 0), jmoo_objective("Score", False, 0, 1), jmoo_objective("Completion", False, 0, 1), jmoo_objective("Idle", True, 0, 1)]
Exemple #11
0
 def __init__(prob):
     prob.name = "BNH"
     prob.decisions = [jmoo_decision("x1", 0, 5), jmoo_decision("x2", 0, 3)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #12
0
 def __init__(prob):
     prob.name = "Schaffer"
     prob.decisions = [jmoo_decision("x1", -10, 10)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #13
0
 def __init__(prob):
     prob.name = "BiasTest"
     prob.decisions = [jmoo_decision("x1", 0, 1), jmoo_decision("x2", 0, 1)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #14
0
 def __init__(prob):
     prob.name = "A001_Test"
     prob.A = 0.01
     prob.decisions = [jmoo_decision("x1", 0, 1)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #15
0
 def __init__(prob, n):
     prob.name = "JoeTest1"
     names = ["x1", "x2", "x3"]
     prob.decisions = [jmoo_decision(names[i], -2, 2) for i in range(n)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #16
0
 def __init__(prob):
     prob.name = "Srinivas"
     prob.decisions = [
         jmoo_decision("x" + str(i + 1), -20, 20) for i in range(2)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #17
0
 def __init__(prob):
     prob.name = "POM3MIN"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency", "Dynamism",
              "Size", "Plan", "Team Size"]
     LOWS = [0.80, 1.22, 2, 0.60, 0, 1, 0, 0, 1]
     UPS = [0.90, 1.62, 6, 0.62, 2, 3, 1, 1, 3]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     prob.objectives = [jmoo_objective("Cost", True), jmoo_objective("Score", False),
                        jmoo_objective("Completion", False), jmoo_objective("Idle", True)]
Exemple #18
0
 def __init__(prob, n):
     prob.name = "Kursawe"
     names = ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"]
     n = max(min(8, n), 1)  #constrain n to its range
     prob.decisions = [jmoo_decision(names[i], -5, 5) for i in range(n)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #19
0
 def __init__(prob):
     prob.name = "ConstrEx"
     prob.decisions = [
         jmoo_decision("x1", 0.1, 1.0),
         jmoo_decision("x2", 0, 5)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #20
0
 def __init__(prob):
     prob.name = "ZDT6"
     names = ["x" + str(i + 1) for i in range(10)]
     prob.decisions = [
         jmoo_decision(names[i], 0, 1) for i in range(len(names))
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #21
0
 def __init__(prob):
     prob.name = "Poloni"
     prob.decisions = [
         jmoo_decision("x1", -math.pi, math.pi),
         jmoo_decision("x2", -math.pi, math.pi)
     ]
     prob.objectives = [
         jmoo_objective("f1", False),
         jmoo_objective("f2", False)
     ]
Exemple #22
0
 def __init__(prob, n=30):
     prob.name = "UF10"
     prob.decisions = [
         jmoo_decision("x" + str(i), 0, 1) for i in range(2)
     ] + [jmoo_decision("x" + str(j), -2, 2) for j in range(2, n)]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True),
         jmoo_objective("f3", True)
     ]
Exemple #23
0
 def __init__(prob):
     prob.name = "Tanaka"
     prob.decisions = [
         jmoo_decision("x1", -math.pi, math.pi),
         jmoo_decision("x2", -math.pi, math.pi)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #24
0
 def __init__(prob):
     prob.name = "POM3B"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency",
              "Dynamism", "Size", "Plan", "Team Size"]
     LOWS = [0.10, 0.82, 80, 0.40, 0,   1, 0, 0, 1]
     UPS  = [0.90, 1.26, 95, 0.70, 100, 50, 2, 5, 20]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     prob.objectives = [jmoo_objective("Cost", True, 0), jmoo_objective("Score", True, 0, 1),
                        # jmoo_objective("Completion", False, 0, 1)]
                       jmoo_objective("Idle", True, 0, 1)]
Exemple #25
0
 def __init__(prob):
     prob.name = "TwoBarTruss"
     prob.decisions = [
         jmoo_decision("x1", 0, 0.01),
         jmoo_decision("x2", 0, 0.01),
         jmoo_decision("x3", 1, 3)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #26
0
 def __init__(prob):
     prob.name = "Viennet4"
     prob.decisions = [
         jmoo_decision("x1", -4, 4),
         jmoo_decision("x2", -4, 4)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True),
         jmoo_objective("f3", True)
     ]
Exemple #27
0
 def __init__(prob, percentage=-1):
     prob.percentage=percentage
     prob.name = "POM3D_1_2"
     names = ["Culture", "Criticality", "Criticality Modifier", "Initial Known", "Inter-Dependency", "Dynamism",
              "Size", "Plan", "Team Size"]
     LOWS = [0.10, 0.82, 2, 0.60, 80, 1, 0, 0, 10]
     UPS = [0.20, 1.26, 8, 0.95, 100, 10, 2, 5, 20]
     prob.decisions = [jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))]
     # prob.objectives = [jmoo_objective("Cost", True, 0), jmoo_objective("Score", False, 0, 1),
     #                    jmoo_objective("Completion", False, 0, 1)]#, jmoo_objective("Idle", True, 0, 1)]
     prob.objectives = [jmoo_objective("Cost", True, 0), jmoo_objective("Score", True, 0, 1)]
Exemple #28
0
 def __init__(prob, n):
     prob.evals = 0
     prob.name = "Fonseca"
     names = ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8"]
     n = max(min(8, n), 1)  #constrain n to its range
     prob.decisions = [
         jmoo_decision("x" + str(i + 1), -2, 2) for i in range(n)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #29
0
 def __init__(prob):
     prob.name = "Osyczka2"
     lows = [0, 0, 1, 1, 0, 0]
     ups = [10, 10, 5, 5, 6, 10]
     names = ["x1", "x2", "x3", "x4", "x5", "x6"]
     prob.decisions = [
         jmoo_decision(names[i], lows[i], ups[i]) for i in range(6)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #30
0
 def __init__(prob):
     prob.name = "Golinski"
     names = ["x1", "x2", "x3", "x4", "x5", "x6", "x7"]
     LOWS = [2.6, 0.7, 17.0, 7.3, 7.3, 2.9, 5.0]
     UPS = [3.6, 0.8, 28.0, 8.3, 8.3, 3.9, 5.5]
     prob.decisions = [
         jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(7)
     ]
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
Exemple #31
0
 def __init__(self, name,  objnum = 3):
     self.name = name
     assert(if_exists(name) is True), "Check the filename"
     self.url = "./Problems/Feature_Models/References/" + name + ".xml"
     spl_cost_data = "./Problems/Feature_Models/Cost/" + name + ".cost"
     self.ft = load_ft_url(self.url)
     self.ft.load_cost(spl_cost_data)
     lows = [0 for _ in xrange(len(self.ft.leaves))]
     ups = [1 for _ in xrange(len(self.ft.leaves))]
     names = ["x"+str(i) for i in xrange(len(self.ft.leaves))]
     self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in xrange(len(self.ft.leaves))]
     self.objectives = [jmoo_objective("fea", True), jmoo_objective("conVio", True), jmoo_objective("Cost", True)]
Exemple #32
0
 def __init__(prob):
     prob.name = "ZDT4"
     names = ["x" + str(i + 1) for i in range(10)]
     prob.decisions = [
         jmoo_decision(names[i], -5, 5) for i in range(len(names))
     ]
     prob.decisions[0].low = 0
     prob.decisions[0].up = 1
     prob.objectives = [
         jmoo_objective("f1", True),
         jmoo_objective("f2", True)
     ]
    def __init__(self, name,  objnum = 3):

        self.name = name
        assert(if_exists(name) is True), "Check the filename"
        self.url = "./Problems/Feature_Models/References/" + name + ".xml"
        spl_cost_data = "./Problems/Feature_Models/Cost/" + name + ".cost"
        self.ft = load_ft_url(self.url)
        self.ft.load_cost(spl_cost_data)
        lows = [0 for _ in xrange(len(self.ft.leaves))]
        ups = [1 for _ in xrange(len(self.ft.leaves))]
        names = ["x"+str(i) for i in xrange(len(self.ft.leaves))]
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in xrange(len(self.ft.leaves))]
        self.objectives = [jmoo_objective("fea", True), jmoo_objective("conVio", True), jmoo_objective("Cost", True)]
Exemple #34
0
 def __init__(self, name, valid_solutions=False, objnum=3, is_binary=False):
     self.name = name
     self.valid_solutions = valid_solutions
     assert(if_exists(name) is True), "Check the filename"
     self.url = "./Problems/Feature_Models/References/" + name + ".xml"
     spl_cost_data = "./Problems/Feature_Models/Cost/" + name + ".cost"
     self.ft = load_ft_url(self.url)
     self.ft.load_cost(spl_cost_data)
     lows = [0 for _ in xrange(len(self.ft.leaves))]
     ups = [1 for _ in xrange(len(self.ft.leaves))]
     names = ["x"+str(i) for i in xrange(len(self.ft.leaves))]
     self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in xrange(len(self.ft.leaves))]
     self.objectives = [jmoo_objective("number_of_features", True),
                        jmoo_objective("constrained_violated", True),
                        jmoo_objective("cost", True)]
     self.is_binary = True
Exemple #35
0
    def __init__(self, treatment, requirements=9, name="CPM_APACHE", filename="./data/Apache_AllMeasurements.csv"):
    # def __init__(self, treatment, number=50, requirements=9, name="CPM_APACHE", filename="./Problems/CPM/data/Apache_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        self.no_of_clusters = 0
        # Setting up to create decisions
        names = ["x"+str(i+1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read data
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent,  = self.get_training_data(method=treatment)
        global training_percent
        from math import log, ceil
        # # print training_percent,
        # print "=" * 20
        # print "Reduced data: ", self.training_dependent
        # print "total run time: ", sum(self.training_dependent)
        # print "totol total run time: ", self.find_total_time()
        # print "sadsadsa time: ", self.find_total_time() - sum(self.training_dependent)
        # print "Saving Percentage: ", (sum(self.training_dependent)/self.find_total_time()) *100
        # print "Length of self.data: ", len(self.data)
        # print treatment.__name__


        print "Length of training dataset: ", len(self.training_dependent), len(self.data), (2*log(len(self.data) * training_percent, 2))
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
        self.saved_time = (self.find_total_time() - sum(self.training_dependent))/10**4
Exemple #36
0
    def __init__(self, treatment, requirements=9, name="CPM_APACHE", filename="./Data/Apache_AllMeasurements.csv"):
    # def __init__(self, treatment, number=50, requirements=9, name="CPM_APACHE", filename="./Problems/CPM/Data/Apache_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        self.no_of_clusters = 0
        # Setting up to create decisions
        names = ["x"+str(i+1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent,  = self.get_training_data(method=treatment)
        global training_percent
        from math import log, ceil
        # # print training_percent,
        # print "=" * 20
        # print "Reduced Data: ", self.training_dependent
        # print "total run time: ", sum(self.training_dependent)
        # print "totol total run time: ", self.find_total_time()
        # print "sadsadsa time: ", self.find_total_time() - sum(self.training_dependent)
        # print "Saving Percentage: ", (sum(self.training_dependent)/self.find_total_time()) *100
        # print "Length of self.Data: ", len(self.Data)
        # print treatment.__name__


        print "Length of training dataset: ", len(self.training_dependent), len(self.data), (2*log(len(self.data) * training_percent, 2))
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
        self.saved_time = (self.find_total_time() - sum(self.training_dependent))/10**4
Exemple #37
0
    def __init__(self, treatment, number=50, requirements=16, fraction=0.5, name="cpm_X264", filename="./Data/X264_AllMeasurements.csv"):
    # def __init__(self, treatment, number=50, requirements=16, fraction=0.5, name="cpm_X264", filename="./Problems/CPM/Data/X264_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        # Setting up to create decisions
        names = ["x"+str(i+1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)



        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        global training_percent
        # print training_percent,
        from math import log
        # print "Length of training dataset: ", len(self.training_dependent), len(self.Data), (2*log(len(self.Data) * training_percent, 2))

        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
        self.saved_time = (self.find_total_time() - sum(self.training_dependent))/10**4
Exemple #38
0
    def __init__(self,
                 treatment,
                 number=50,
                 requirements=16,
                 fraction=0.5,
                 name="cpm_X264",
                 filename="./Data/X264_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        if treatment is None:
            treatment = random_where
        elif treatment == 0:
            treatment = base_line
        # Setting up to create decisions
        names = ["x" + str(i + 1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [
            jmoo_decision(names[i], lows[i], ups[i])
            for i in range(requirements)
        ]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)
        self.training_independent, self.training_dependent = self.get_training_data(
            method=treatment)
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent,
                                  self.training_dependent)
        self.saved_time = (self.find_total_time() -
                           sum(self.training_dependent)) / 10**4
 def __init__(prob, numDecs=20, numObjs=2):
     prob.name = "DTLZ6_" + str(numDecs) + "_" + str(numObjs)
     names = ["x"+str(i+1) for i in range(numDecs)]
     lows =  [0.0 for i in range(numDecs)]
     ups =   [1.0 for i in range(numDecs)]
     prob.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(numDecs)]
     prob.objectives = [jmoo_objective("f" + str(i+1), True) for i in range(numObjs)]
    def __init__(
        self,
        treatment,
        number=50,
        requirements=16,
        fraction=0.5,
        name="cpm_X264",
        filename="./Data/X264_AllMeasurements.csv",
    ):
        # def __init__(self, treatment, number=50, requirements=16, fraction=0.5, name="cpm_X264", filename="./Problems/CPM/Data/X264_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        # Setting up to create decisions
        names = ["x" + str(i + 1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        global training_percent
        # print training_percent,
        from math import log

        # print "Length of training dataset: ", len(self.training_dependent), len(self.Data), (2*log(len(self.Data) * training_percent, 2))

        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
        self.saved_time = (self.find_total_time() - sum(self.training_dependent)) / 10 ** 4
Exemple #41
0
 def __init__(self, requirements, releases, clients, density, budget):
     self.name = (
         "NRP_"
         + str(requirements)
         + "_"
         + str(releases)
         + "_"
         + str(clients)
         + "_"
         + str(density)
         + "_"
         + str(budget)
     )
     names = ["x" + str(i + 1) for i in range(requirements)]  # |x_i + y_i|
     lows = [-1 for i in xrange(requirements)]
     ups = [(releases - 1) for _ in xrange(requirements)]
     self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
     self.objectives = [jmoo_objective("f1", False)]  # , jmoo_objective("f2", False)]  # single objective nrp
     self.trequirements = requirements
     self.treleases = releases
     self.tclients = clients
     self.tdensity = density
     self.tbudget = budget
     self.requirement = None
     self.client = None
     self.release = None
     self.precedence = []
     self.generate_data()
    def __init__(
        self, treatment, number=50, requirements=18, name="CPM_BDBC", filename="./Data/BDBC_AllMeasurements.csv"
    ):
        # def __init__(self, treatment, number=50, requirements=18, name="CPM_BDBC", filename="./Problems/CPM//Data/BDBC_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        if treatment is None:
            treatment = east_west_where
        elif treatment == 0:
            treatment = base_line
        names = ["x" + str(i + 1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        self.objectives = [jmoo_objective("f1", True)]
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        global training_percent
        # print "inside: ", training_percent
        from math import log

        # print "Length of training dataset: ", len(self.training_dependent), len(self.Data), (2*log(len(self.Data) * training_percent, 2))

        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)

        self.saved_time = (self.find_total_time() - sum(self.training_dependent)) / 10 ** 4
    def __init__(self, treatment, requirements=9, name="CPM_APACHE", filename="./Data/Apache_AllMeasurements.csv"):
        self.name = name
        self.filename = filename

        if treatment is None:
            treatment = random_where
        elif treatment == 0:
            treatment = base_line

        # Setting up to create decisions (This is something specific from the JMOO framework
        names = ["x" + str(i + 1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]

        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]

        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
        self.saved_time = (self.find_total_time() - sum(self.training_dependent))/10**4
Exemple #44
0
 def __init__(prob):
     prob.name = "POM3Csanscomp"
     names = [
         "Culture", "Criticality", "Criticality Modifier", "Initial Known",
         "Inter-Dependency", "Dynamism", "Size", "Plan", "Team Size"
     ]
     LOWS = [0.50, 0.82, 2, 0.20, 0, 40, 2, 0, 20]
     UPS = [0.90, 1.26, 8, 0.50, 50, 50, 4, 5, 44]
     prob.decisions = [
         jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))
     ]
     prob.objectives = [
         jmoo_objective("Cost", True, 0),
         jmoo_objective("Score", False, 0, 1),
         jmoo_objective("Idle", True, 0, 1)
     ]
    def __init__(self,
                 treatment,
                 number=50,
                 requirements=18,
                 name="CPM_BDBC",
                 filename="./Data/BDBC_AllMeasurements.csv"):
        # def __init__(self, treatment, number=50, requirements=18, name="CPM_BDBC", filename="./Problems/CPM//Data/BDBC_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        if treatment is None: treatment = east_west_where
        elif treatment == 0: treatment = base_line
        names = ["x" + str(i + 1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        self.decisions = [
            jmoo_decision(names[i], lows[i], ups[i])
            for i in range(requirements)
        ]
        self.objectives = [jmoo_objective("f1", True)]
        self.header, self.data = read_csv(self.filename, header=True)

        self.training_independent, self.training_dependent = self.get_training_data(
            method=treatment)
        global training_percent
        # print "inside: ", training_percent
        from math import log
        # print "Length of training dataset: ", len(self.training_dependent), len(self.Data), (2*log(len(self.Data) * training_percent, 2))

        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent,
                                  self.training_dependent)

        self.saved_time = (self.find_total_time() -
                           sum(self.training_dependent)) / 10**4
Exemple #46
0
 def __init__(prob, percentage=-1):
     prob.percentage = percentage
     prob.name = "POM3B_2_3"
     names = [
         "Culture", "Criticality", "Criticality Modifier", "Initial Known",
         "Inter-Dependency", "Dynamism", "Size", "Plan", "Team Size"
     ]
     LOWS = [0.10, 0.82, 80, 0.40, 0, 1, 0, 0, 1]
     UPS = [0.90, 1.26, 95, 0.70, 100, 50, 2, 5, 20]
     prob.decisions = [
         jmoo_decision(names[i], LOWS[i], UPS[i]) for i in range(len(names))
     ]
     prob.objectives = [
         jmoo_objective("Score", True, 0, 1),
         jmoo_objective("Idle", True, None, None)
     ]
 def __init__(prob, numDecs=10, numObjs=3):
     super(car_impact, prob).__init__()
     prob.name = "Car_Impact_" + str(numDecs) + "_" + str(numObjs)
     names = ["x"+str(i+1) for i in range(numDecs)]
     lows =  [0.0 for i in range(numDecs)]
     ups =   [1.0 for i in range(numDecs)]
     prob.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(numDecs)]
     prob.objectives = [jmoo_objective("f" + str(i+1), True) for i in range(numObjs)]
Exemple #48
0
 def __init__(prob, numDecs=10, numObjs=2):
     super(dtlz5, prob).__init__()
     prob.name = "DTLZ5"
     names = ["x"+str(i+1) for i in range(numDecs)]
     lows =  [0.0 for i in range(numDecs)]
     ups =   [1.0 for i in range(numDecs)]
     prob.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(numDecs)]
     prob.objectives = [jmoo_objective("f" + str(i+1), True) for i in range(numObjs)]
Exemple #49
0
 def __init__(prob, numDecs=10, numObjs=2):
     super(c2_convex_dtlz2, prob).__init__()
     prob.name = "Convex_DTLZ2_" + str(numDecs) + "_" + str(numObjs)
     names = ["x"+str(i+1) for i in range(numDecs)]
     lows =  [0.0 for i in range(numDecs)]
     ups =   [1.0 for i in range(numDecs)]
     prob.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(numDecs)]
     prob.objectives = [jmoo_objective("f" + str(i+1), True) for i in range(numObjs)]
Exemple #50
0
 def __init__(prob, dataset_name, instances=100, features=20, nol=30, noc=0.3, tuning_precent=20):
     prob.name = "hpcc_kmeans_" + dataset_name
     prob.features = features
     prob.instances = instances
     prob.dataset_name = dataset_name
     prob.tuning_instances = sample(range(1, prob.instances + 1), int(prob.instances * tuning_precent / 100))
     prob.conv = noc
     prob.decisions = [jmoo_decision("k", 1, int(features ** 0.5)), jmoo_decision("number_of_loops", 1, nol)]
     prob.objectives = [jmoo_objective("convergence", True)]
     prob.is_binary = False
Exemple #51
0
 def __init__(prob, dataset_name, features=20):
     prob.name = "hpcc_rf_" + dataset_name
     prob.dataset_name = dataset_name
     prob.decisions = [
         jmoo_decision("no_trees", 80, 120),
         jmoo_decision("no_features", 4, features),
         jmoo_decision("purity", 0.6, 1),
         jmoo_decision("depth", 80, 120),
     ]
     prob.objectives = [jmoo_objective("accuracy", True)]
     prob.is_binary = False
Exemple #52
0
 def __init__(self, requirements=18, fraction=0.5, name="CPM_BDBC", filename="./Problems/CPM/Data/BDBC_AllMeasurements.csv"):
     self.name = name
     self.filename = filename
     names = ["x"+str(i+1) for i in xrange(requirements)]
     lows = [0 for _ in xrange(requirements)]
     ups = [1 for _ in xrange(requirements)]
     self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
     self.objectives = [jmoo_objective("f1", True)]
     self.data = read_csv(self.filename)
     self.testing_independent, self.testing_dependent = [], []
     self.training_independent, self.training_dependent = self.get_training_data(fraction)
     self.CART = tree.DecisionTreeRegressor()
     self.CART = self.CART.fit(self.training_independent, self.training_dependent)
Exemple #53
0
 def __init__(self, tree, obj_funcs=None, **settings):
     jmoo_problem.__init__(self)
     if not obj_funcs:
         obj_funcs = [eval_softgoals, eval_goals, eval_coverage]
     self.name = tree.name
     self.obj_funcs = obj_funcs
     self._tree = tree
     self.roots = self._tree.get_roots()
     self.bases = self._tree.get_bases()
     obj_names = [func.__name__.split("_")[1] for func in obj_funcs]
     dec_names = [base.id for base in self.bases]
     self.decisions = [jmoo_decision(dec_names[i], f, t) for i in range(len(dec_names))]
     self.objectives = [jmoo_objective(obj_names[i], True) for i in range(len(obj_names))]
     self.chain = set()
     self.is_percent = settings.get("obj_is_percent", True)
Exemple #54
0
    def __init__(self, treatment, number=50, requirements=18, name="CPM_BDBC", filename="./Problems/CPM//Data/BDBC_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        if treatment is None: treatment = random_where
        elif treatment == 0: treatment = base_line
        names = ["x"+str(i+1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        self.objectives = [jmoo_objective("f1", True)]
        self.header, self.data = read_csv(self.filename, header=True)
        print "Length of Data: ", len(self.data)

        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
Exemple #55
0
    def __init__(self, treatment, number=50, requirements=16, fraction=0.5, name="cpm_X264", filename="./Problems/CPM/Data/X264_AllMeasurements.csv"):

        self.name = name
        self.filename = filename
        if treatment is None: treatment = random_where
        elif treatment == 0: treatment = base_line
        # Setting up to create decisions
        names = ["x"+str(i+1) for i in xrange(requirements)]
        lows = [0 for _ in xrange(requirements)]
        ups = [1 for _ in xrange(requirements)]
        # Generating decisions
        self.decisions = [jmoo_decision(names[i], lows[i], ups[i]) for i in range(requirements)]
        # Generating Objectives (this is single objective)
        self.objectives = [jmoo_objective("f1", True)]
        # Read Data
        self.header, self.data = read_csv(self.filename, header=True)
        self.training_independent, self.training_dependent = self.get_training_data(method=treatment)
        self.CART = tree.DecisionTreeRegressor()
        self.CART = self.CART.fit(self.training_independent, self.training_dependent)
Exemple #56
0
 def __init__(prob, n=30):
     prob.name = "UF10"
     prob.decisions = [jmoo_decision("x" + str(i), 0, 1) for i in range(2)] + [jmoo_decision("x" + str(j), -2, 2) for j in range(2, n)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True), jmoo_objective("f3", True)]
Exemple #57
0
 def __init__(prob, n):
     prob.name = "JoeTest1"
     names = ["x1", "x2", "x3"]
     prob.decisions = [jmoo_decision(names[i], -2, 2) for i in range(n)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #58
0
 def __init__(prob):
     prob.name = "Tanaka"
     prob.decisions = [jmoo_decision("x1",-math.pi, math.pi),jmoo_decision("x2", -math.pi, math.pi)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #59
0
 def __init__(prob):
     prob.name = "ConstrEx"
     prob.decisions = [jmoo_decision("x1",0.1, 1.0),jmoo_decision("x2", 0, 5)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]
Exemple #60
0
 def __init__(prob):
     prob.name = "Srinivas"
     prob.decisions = [jmoo_decision("x" + str(i+1), -20, 20) for i in range(2)]
     prob.objectives = [jmoo_objective("f1", True), jmoo_objective("f2", True)]