Resource Constraints
Time, Money, and other Resource Constraints
Constraints
Sometimes when writing a procedure you need to indicate how long something is
allowed to take. You do that using the {within x} keyword. This creates a scope that you expect to be
completed within the resource budget specified.
occupy_exceptionally_large_mind :
Carry out demanding tasks. None of them will achieve job satisfaction.
@paranoid_android
{ within 1 day }
- Escort aliens up from number two entry bay, even though it
will not be enjoyable
- Guard the ship even though there's no one around it needs
guarding from <power_saving>
- Avoid being bored and depressed by making friends with
another ship
a. Plug in to external computer port
b. Explain philosophy of life
This lists the tasks that the manically depressed robot needs to do, and gives a time constraint they are to occur within, 1 day in this case.
Resources
Costs can be specified in terms of time duration, an amount of money, or a
resource to be consumed. Costs can be written using the cost literal syntax {$(2 minutes)} syntax for a duration,
{$(5 pounds)} or {$(5 GBP)} for a currency, or {$(6 pints)} for an amount.
Cost literals can be written in procedure descriptions or step content.
Although cost literals are written using quantities, they become a different type once constructed. You can see that here, where we have both a quantity and a cost in the same step:
power_saving :
Sunset on an alien world is rubbish. Power down and go to sleep, not that
there's any point in bothering.
@paranoid_android
- Count { 597 × 10⁹ sheep } to fall asleep $(1 second)
In both of these examples we see the expected duration of the step. You can later compare the total cost of steps in a procedure, and find out whether a task can be completed within budget.
Costs are a kind of value, and the literal form above can also be used in an expression. When evaluated, costs are called Intratempse values.