Quick Start Guide
Follow this guide if you are _already_ familiar with Scala, SBT, etc.
If you have little experience with Scala or SBT, we recommend that you follow our Getting Started guide instead.
In your source file, import the Mechanical Turk adapter (Scala syntax):
After that, initialize the AutoMan runtime with an MTurk config:
and then define your task:
You may then call which_one
just like an ordinary function (which it is). Note that AutoMan functions immediately return an Outcome
, but continue to execute asynchronously in the background. AutoMan builds on top of a Scala feature called a future to make this happen.
To access return values, pattern-match on the Outcome
's answer
field, e.g.,
Other possible cases are LowConfidenceAnswer
and OverBudgetAnswer
. If you run out of money during a computation, a LowConfidenceAnswer
will let you access to lower-confidence results. An OverBudgetAnswer
signals that you didn't have enough money in your budget to begin with.
Cleanup of AutoMan Resources
Note that, due to AutoMan's design, you must inform it when to shut down, otherwise it will continue to execute indefinitely and your program will hang:
Alternately, you may wrap your program in an automan
statement, and cleanup will happen automatically. This feature was inspired by the C# using
statement:
We will add more documentation to this site in the near future. In the interim, please see the collection of sample programs in the apps
directory.
Last updated