def inactiveBid(bidId, strProv, serviceId, delay, price): bid = Bid() bid.setValues(bidId, strProv, serviceId) bid.setDecisionVariable("1", price) # Price bid.setDecisionVariable("2", delay) # Delay bid.setStatus(Bid.INACTIVE) message = bid.to_message() return message, bidId
def createBid(strProv, serviceId, delay, price): bid = Bid() uuidId = uuid.uuid1() # make a UUID based on the host ID and current time idStr = str(uuidId) bid.setValues(idStr, strProv, serviceId) bid.setDecisionVariable("1", price) # Price bid.setDecisionVariable("2", delay) # Delay bid.setStatus(Bid.ACTIVE) message = bid.to_message() return message, idStr