def simulateABiddingStategyWithParameter(cases, tcost, proportion, algo, para):
    budget = int(tcost / proportion)
    cost = 0
    clks = 0
    cnvs = 0
    bids = 0
    imps = 0
    for idx in range(0, len(cases)):
        bid = 0
        if algo == "const":
            bid = const(para)
        elif algo == "rand":
            bid = rand(para)
        elif algo == "mcpc-lr":
            lrpctr = lrpctrs[idx]
            bid = mcpc(tecpc, lrpctr)
        elif algo == "mcpc-gbrt":
            gbrtpctr = gbrtpctrs[idx]
            bid = mcpc(tecpc, gbrtpctr)
        elif algo == "lin-lr":
            lrpctr = lrpctrs[idx]
            bid = lin(lrpctr, tctr, para)
        elif algo == "lin-gbrt":
            gbrtpctr = gbrtpctrs[idx]
            bid = lin(gbrtpctr, tctr, para)
        else:
            print 'wrong algo'
            sys.exit(-1)
        bids += 1
        case = cases[idx]
        if win(case, bid):
            imps += 1
            clks += case[0]
            cnvs += case[1]
            cost += case[3]
        if cost > budget:
            break
    return str(proportion) + '\t' + str(clks) + '\t' + str(cnvs) + '\t' + str(bids) + '\t' + \
            str(imps) + '\t' + str(budget) + '\t' + str(cost) + '\t' + algo + '\t'+ str(para)
dataset/ETHPy150Open wnzhang/optimal-rtb/python/dsp-eval.py/simulateABiddingStategyWithParameter/original