/* ** scenario03.txt - restriction scenario(set maximum drop rate within the first days)). ** (C) Copyright 2005 Yosuke Amijima. All Rights Reserved. ** ** Purpose: Get the status whether or not path S is restricted. ** ** Format: status=scenario03(S,maxfirstdroprate,firstdays); ** ** Input: S vector, a path to be determined whether or not it is used ** ** maxfirstdroprate scalar, maximum drop rate from S0 ** ** firstdays scalar, looking the 'firstdays' days ** ** ** Output: status scalar, 1 if restricted, 0 otherwise ** ** Example If (1-maxfirstdroprate)*S0>S, then 1. */ proc scenario03(S,maxfirstdroprate,firstdays); if minc(S[1:firstdays+1])<(1-maxfirstdroprate)*S[1]; retp(1); else; retp(0); endif; endp;