Question: Cycling Simulation

Hi i'm working on a simulation and have got stuck. The simulation is for cyclists cycling on a circular track. There is a section of track which is treacherous and all cyclists who pass through this point must observe a certain maximum speed until they have cleared this area and can continue round the track as fast as they can although keeping a safe distance behind the cyclist in front. It is assumed for simplicity that cyclists cannot overtake each other. These are my workings so far: >bicycle := (pl,sl,len) -> (pl+sl) mod len: > >vel:= proc(pl,len,vmax) > local n; > [seq(min((pl[n+1]-pl[n]-1) mod len,vmax),n=1..nops(pl)-1), > min((pl[1]-pl[-1]-1) mod len,vmax)] > end proc: > >L:=100; N:=10; pos:= [seq(n*10,n=0..N-1)]; speed:=[4$N]; >trechmax:=3; > >for k to N do > pos:= bicycle(pos,speed,L); > speed:= vel(pos,L,8); > for n to N do > if pos[n]>=17 and pos[n]
Please Wait...