Implementing a Market-Based Generic Resource Scheduler in C++

As part of my work this term, I implemented a generic resource scheduler in C++. This scheduler uses dynamic pricing to allocate a fixed amount of a generic resource among many interested parties. Potential buyers submit demand functions to buy quanta of the resource.

Individual demand is expressed as polynomial functions of price. The functions must be decreasing for all non negative prices.

Buying a quanta represents the right to use that proportion of the resource in exchange for an agreed upon payment for every time period into the future until aggregate consumer demand changes.

In the event that demand does change, the scheduler recalculates a competitively optimal price. That is, the scheduler picks the highest price it can while still selling all of the resource quanta. Note, this may not be an totally optimal price; if there are few competing supplies, selling lower quantities at a higher price will raise profits at the expense of overall performance.

Restricting Access

As part of allocating resources, a system must protect the resources from over consumption. As a first attempt, I adapted the scheduler to distribute network access among agent programs. This entails measuring how much time an agent spends writing data to the network and inserting wait delays to enforce access quotas.

Inserting Network Access Scheduler into Agent-Tcl

Late in the term, I adapted Agent-Tcl to use this system of network access. The figure below shows roughly the data path of the scheduling.

To avoid transaction overhead and to deal with fluctuating prices, the system requires uses to pay a lump sum and then run a balance with the server.

Currently, there is no mechanism to enforce that clients must use the scheduler and there are several methods to override the scheduler.

A major problem is measuring actual time spent sending data. Currently the highest resolution the scheduler can measure is a clock tick (about 1/60th of a second). This sort of restriction is insufficient for all but the most blatant offenders of the quota. Another metric would be to measure the number of bytes sent, but the actual cost of the message is dependent on the time take to send messages which is not entirely related to message size.

Jon Bredin

The D'Agents Project ended in approximately 2003. The software, and this web site, is no longer maintained. For questions please contact David Kotz.