Ejemplo n.º 1
0
def plotOptR(n, aroundPoint=None, aroundN=None, colorStates=False, **kwargs):
	# don't plot red states
	stateArray = getStateArray(n)
	def filterFn(x):
		(iM, iD) = getNearestGridPoint(x[0], x[1])
		if (stateArray[iM, iD] != g.STATE_RED):
			return True
		return False
	fnObj = linterp.GetLinterpFnObj(g.stateGridList, bellman.getIter(n)['opt_r'])
	return plot3d.plotSurface(g.grid_M, g.grid_D, fnObj, xlabel="M", ylabel="D", zlabel="opt r", colorFn=iterColorFn(n), filterFn=filterFn, drawEntireRegion=True, **kwargs)		
Ejemplo n.º 2
0
def plotOptD(n, aroundPoint=None, aroundN=None, colorStates=False, **kwargs):
	fnObj = linterp.GetLinterpFnObj(g.stateGridList, bellman.getIter(n)['opt_d'])
	return plot3d.plotSurface(g.grid_M, g.grid_D, fnObj, xlabel="M", ylabel="D", zlabel="opt d", colorFn=iterColorFn(n), **kwargs)