Esempio n. 1
0
                                              lb,
                                              ub,
                                              iteration=50,
                                              numBox=1000,
                                              targetMin=0,
                                              scaleOutput=False,
                                              full_output=True)

index = directUtil.findLowestObjIndex(rectListOptim)
rectListOptim[index].getFx()
rectListOptim[index].getLocation()

pyOptimUtil.direct.plotDirectBox(rectListOptim, lb, ub, scaleOutput=False)

# class object
directObj = directAlg.direct(optimTestFun.rosen, lb, ub)
rectListOptim, output = directObj.divide(50, numBox=10000, full_output=True)

potentialIndex = directUtil.identifyPotentialOptimalObjectPareto(rectListOptim)
pyOptimUtil.direct.directUtil.plotParetoFrontRect(rectListOptim,
                                                  potentialIndex)

pyOptimUtil.direct.plotDirectBox(rectListOptim, lb, ub, scaleOutput=False)

# in terms of inequalities
A, b = polyOperation.addBoxToInequalityLBUB(lb, ub)

directObj = directAlg.direct(optimTestFun.gp, lb, ub, A, b)
polyListOptim, output = directObj.divide(10, numBox=2000, full_output=True)

potentialIndex = polyOperation.identifyPotentialOptimalPolygonPareto(
Esempio n. 2
0
    print newPolyList[i].getMaxDistanceToVertices()

pyOptimUtil.direct.plotDirectPolygon(newPolyList, potentialIndex)

x, sol, G, h = polyOperation.findAnalyticCenter(A, b, full_output=True)

import pyOptimUtil.direct

rectListOptim, output = directAlg.directOptim(
    optimTestFun.rosen, lb, ub, iteration=50, numBox=1000, targetMin=0, scaleOutput=False, full_output=True
)

pyOptimUtil.direct.plotDirectBox(rectListOptim, lb, ub, scaleOutput=False)

# class object
directObj = directAlg.direct(optimTestFun.rosen, lb, ub)
rectListOptim = directObj.divide(10)


directObj = directAlg.direct(optimTestFun.rosen, lb, ub, A, b)
polyListOptim = directObj.divide(5)

potentialIndex = polyOperation.identifyPotentialOptimalPolygonPareto(polyListOptim)

pyOptimUtil.direct.plotDirectPolygon(polyListOptim, potentialIndex)

polyListOptim = directObj.divide(1)

potentialIndex = polyOperation.identifyPotentialOptimalPolygonPareto(polyListOptim)

pyOptimUtil.direct.plotDirectPolygon(polyListOptim, potentialIndex)
Esempio n. 3
0
                                                 scaleOutput=False,
                                                 full_output=True)

directUtil.plotDirectBox(rectListOptim,lb,ub,scaleOutput=False)

from pyOptimUtil.direct import optimTestFun, directAlg, directUtil
import pyOptimUtil.direct 

optimalListLipschitz = pyOptimUtil.direct.identifyPotentialOptimalRectangleLipschitz(rectListOptim)
optimalList = pyOptimUtil.direct.identifyPotentialOptimalRectanglePareto(rectListOptim)

directUtil.plotParetoFront(rectListOptim,optimalList)

# can also use the class instead

directClass = directAlg.direct(optimTestFun.rosen,lb,ub)
rectListOptim = directClass.divide()

optimalListLipschitz = pyOptimUtil.direct.identifyPotentialOptimalRectangleLipschitz(rectListOptim)
optimalListPareto = pyOptimUtil.direct.identifyPotentialOptimalRectanglePareto(rectListOptim)

directUtil.plotDirectBox(rectListOptim,lb,ub,False,optimalListPareto)

directUtil.plotParetoFront(rectListOptim,optimalListPareto)

#####
#
# SIR model with two parameters
#
#####
Esempio n. 4
0

pro = GLP(f=objLegrand.cost,x0=theta,df=objLegrand.sensitivity,lb=lb,ub=ub)
pro.plot = True
rGalileo = pro.solve('galileo')

pro = GLP(f=objLegrand.cost,x0=theta,df=objLegrand.sensitivity,lb=lb,ub=ub)
pro.plot = True
rDe = pro.solve('de')

#
# DIRECT!
# 
from pyOptimUtil.direct import polyOperation, directAlg

directObj = directAlg.direct(objLegrand.cost,lb,ub)
rectListOptim,output = directObj.divide(1000,numBox=10000,full_output=True)

A,b = polyOperation.addBoxToInequalityLBUB(lb,ub)

directObj = directAlg.direct(objLegrand.cost,lb,ub,A,b)
polyListOptim,output = directObj.divide(50,numBox=5000,full_output=True)




#
# initial values
# 

thetaIV = resQPRefine['x'].tolist() + x0