There is a difference between knowing the path and walking the path.-- Morpheus
Next
method makes a choice about whether a state transition can occur (e.g. does the driver have capacity?) and calls a method which generates a new state.Value
method when we want to maximize or minimize some objective. The Bounds
method is optional.Bounds
methods from our templates and see how that changes their runtime. Pay special attention to the statistics
section of the JSON output. This shows the number of states explored and deferred for later exploration.UnassignedPenalties
as a slice of cost values (one per location).UnassignedPenalties
are optional and should only be added when the default behavior of enforced assignment is not desired.defaults
section of an input schema) or for specific locations (as detailed above). Unassigned penalties set for specific locations will override the default value (if specified) for those locations in this case.DASH_SIMULATOR_LIMITS_DURATION
environment variable or the -dash.simulator.limits.duration
command-line flag.Run
method. If Run
returns a boolean true value, then Dash schedules it to run again in the simulation.Run
and in response to events.-dash.simulator.random.seed
command-line flag.bash
and zsh
provide a $RANDOM
function which produces a signed 16-bit integer between 0
and 32767
. We can use it to introduce some randomness into a Dash simulation as follows:math/rand
package. The random seed will be recorded in the options
section of Dash's output.Publish
and Subscribe
methods provided by Dash's event ledger work quite well. However, when simulations produce many events or measures, they can become too verbose.PublishLevel
and SubscribeLevel
for calls to Publish
and Subscribe
. The dash/sim/log
package provides the following levels:All
Trace
Debug
Info
Warn
Info
) means you receive every message that is at least as important as that (Info
, Warn
).Publish
and Subscribe
ledger methods use level All
.customer.go
file of the queue example, we can change the Run
method to use: