XmeanGivenCost: A function used to find best coverage given cost and other...

Description Usage Arguments Author(s) Examples

Description

A function used to find best coverage given cost and other constraints

Usage

1
XmeanGivenCost(costPar, cost, P, lower.Xmean, upper.Xmean)

Arguments

costPar
cost
P
lower.Xmean
upper.Xmean

Author(s)

Wei E. Liang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(costPar, cost, P, lower.Xmean, upper.Xmean)
{
	
	CostPerExp <- costPar[1]
	CostPerPool <- costPar[2]
	CostPerX <- costPar[3]

	cost <- rep(cost, length(P))

	Xmean.max <- floor((cost-CostPerExp-CostPerPool*P)/(CostPerX*P))
	Xmean.good <- (Xmean.max >= rep(lower.Xmean, length(Xmean.max)))

	Xmean.max <- ifelse(Xmean.max<lower.Xmean, lower.Xmean, Xmean.max)
	Xmean.max <- ifelse(Xmean.max>upper.Xmean, upper.Xmean, Xmean.max)

	list(Xmean.good, Xmean.max)
  }

hiPOD documentation built on May 1, 2019, 6:34 p.m.