我有以下代码:
configuration(s) := makelist(i, i, 0, length(s) - 1)$
active_agents(s) := s . configuration(s)$
prob_exp[k](l, s) := 1 - exp(- l[k] * active_agents(s))$
当我尝试prob_exp
使用一些具体的值调用时s
,例如:
prob_exp[k](l, [0.25, 0.25, 0.25, 0.25]);
我收到以下错误消息:
length: argument cannot be a symbol; found s
#0: configuration(s=s)
#1: active_agents(s=s)
#2: lambda([k],lambda([l,s],1-exp((-l[k])*active_agents(s))))(k=k)
-- an error. To debug this try: debugmode(true);
有没有办法强制s
作为值传递?