我是 F# 的新手,所以这段代码对我来说似乎很奇怪
let randomTest avgWait avgBusyTime numExp numClients labsRules =
let clients, _ = mkClientsAndLabs numClients labsRules
doTest [for i in 0..numClients-1 -> randomTestClient clients i avgWait avgBusyTime numExp ]
do let clients, _ = mkClientsAndLabs 5 [rulesA; rulesB]
doTest [scheduledClient clients 0 [(0, 500, A)]; // Request a lab at the very start, use for "A" for 0.5 seconds
scheduledClient clients 1 [(200, 300, Mix (Mix (A,Mix (A,A)),B))] ; // Request after 0.2s, release 0.3s later.
scheduledClient clients 2 [(300, 200, Mix (A,Mix (A,A)))]; // These three will all be waiting for a lab.
scheduledClient clients 3 [(400, 200, Mix (A,A))]; // Client 2 should include the others as guests.
scheduledClient clients 4 [(400, 200, A)]
]
我不确定的是do let
声明 - 它显然是在之后声明的,randomTest
但randomTest
仍然可以调用该函数。这段代码执行的顺序是什么?