CS 5260 Project Background

Back to Programming Project landing page

Simulation Definition

A world of M virtual resources is divided among N virtual countries, each with some amount of each resource, including possibly zero units of some resources.

Basic Operations

The are two families of operations: TRANSFORM operations that manipulate resources within a single country and TRANSFER operations that manipulate resources between countries.

Transformations

TRANSFORM operations (a.k.a. Transformations) represent how a country (C) transforms one set of resources into another set of resources (e.g., by manufacturing, agriculture, internal strife, etc.). The resources that comprise the INPUTS and the OUTPUTS are allowed to overlap, indicating that a given input is not completely consumed, or is even increased by the TRANSFORM. All transformations must abide by pre-established templates that outline the unit number of inputs needed to create a unit number of outputs:

 

Housing Template

(TRANSFORM ?C
           (INPUTS (AvailableLand 1)
                   (Population 5)
                   (Water 5)
                   (MetallicElements 1)
                   (Timber 5)
                   (MetallicAlloys 3)
                   (PotentialEnergyUsable 5))
           (OUTPUTS (Housing 1)
                    (HousingWaste 1)
                    (Population 5)
                    (Water 4)))

Alloys Template

(TRANSFORM ?C 
           (INPUTS (Population 1)
                   (MetallicElements 2)
                   (PotentialEnergyUsable 3)
                   (Water 3)) 
           (OUTPUTS (Population 1)
                    (MetallicAlloys 1)
                    (MetallicAlloysWaste 1)
                    (Water 2)))

Electronics Template

(TRANSFORM ?C 
           (INPUTS (Population 1)
                   (MetallicElements 3)
                   (MetallicAlloys 2)
                   (PotentialEnergyUsable 3)
                   (Water 3)) 
           (OUTPUTS (Population 1)
                    (Electronics 2)
                    (ElectronicsWaste 1)
                    (Water 2)))

Transformation templates restrict the kinds of transformations that can take place (e.g., a country cannot arbitrarily transform a combination of “coal” and “water” into “gold”), so we have to agree on templates in advance. Some product outputs from a transform will correspond to “waste” material, which is also represented as a resource, albeit a typically undesirable one.

Our assumption is that a TRANSFORM template applies to any country (i.e., any country can be bound to variable C) that has the requisite inputs.

The non-divisible amounts for each resource (e.g., 1 unit of AvailableLand, 1 unit of Housing) can be multiplied to increase the TRANSFORM yields. So if 5 units of Housing are desired, every resource in the HousingTransform template is multiplied by 5 to achieve the desired operation, thus becoming:

(TRANSFORM ?C
           (INPUTS (AvailableLand 5)
                   (Population 25)
                   (Water 25)
                   (MetallicElements 5)
                   (Timber 25)
                   (MetallicAlloys 15)
                   (PotentialEnergyUsable 25))
           (OUTPUTS (Housing 5)
                    (HousingWaste 5)
                    (Population 25)
                    (Water 20)))

Transfers

TRANSFER operations (a.k.a. Transfers) represent how a country shares its resources with other countries. Each TRANSFER operation is defined by the following template:

(TRANSFER Ci Ck ((Rj1 Xj1) … (Rjm Xjm)))

where Ci gives various amounts (X) of resource R to country Ck. These amounts are sub- tracted from and added to the respective stores of resources in Ci and Ck. The TRANSFER of a list of resources is roughly shorthand for a list of singleton resource transfers, as shown below:

(TRANSFER Ci Ck ((Rj 1 Xj 1 ))) …
(TRANSFER Ci Ck ((Rj m Xj m )))

For example, the following operation transfers 3 Housing units from country C1 to C2: (TRANSFER C1 C2 ((Housing 3)))

Of course, a composite transfer could also be written as a collection of subset transfers, singleton or otherwise. In principle, the composite transfer is informationally equivalent to a collection of subset transfers, but we can imagine that the subset transfers may be inter- spersed with transfers between other countries, much like transactions can be interspersed in a database management system, and these interspersed transfers may lead to different results in a simulation. For Parts 1 and 2, use only singleton TRANSFER operations in schedules that your AI agent explores during its search.

 

Resources and Allowable Transformations

Resources are of various types. Some resources are “basic” or “raw” resources, and some resources are “created” (e.g., manufactured) from other resources using the TRANSFORM operator.

Some resources have explicit positive or negative worth, represented as positive or negative numeric weights, while other resources only have worth in what they enable in the way of resource creation or other meta-operations (see below).

Every created resource with a positive weight has an associated resource with a negative weight, representing waste from the creation process. Negatively-valued created resources have the effect of counter-balancing the world state.

In principle, some resources are renewable, and some are not renewable. An omnipotent “simulation manager” might control the auto-incrementing (renewal) and auto-decrementing (natural loss) of some such resources. In Part 1 we will consider all resources non-renewable, but you can model renewal in Part 2.

In principle, some raw resources can be reclaimed from created resources, at least in part, through recycling. Reclamation could be done through the TRANSFORM operator, and there may be explicit waste associated with it, but “waste” also can be implicit in that some of the original raw resources are lost. Recycling can be modeled in Part 2 of the project.

As noted earlier, transformation templates constrain the kind of transformations of resources that can take place. Most kinds of resources, positive or negative, can be transferred between countries, but some can’t (e.g., analogs to solar power, land).
Raw resources might include

  • Population – renewable
  • Metallic Elements — not renewable
  • Timber – renewable
  • Available Land — not renewable
  • Potential Renewable Energy — solar, wind, water
  • Potential Fossil Energy — oil, coal, natural gas
  • Water

Created Resources might include

  • Military and Military Waste
  • Metallic Alloys and Metallic Alloys Waste
  • Housing and Housing Waste
  • Food and Food/farm Waste
  • Potential Fossil Energy Usable (such as extracted and refined fossil fuels) and Potential Fossil Energy Usable Waste (e.g., waste as a result of the extraction process)
  • Potential Renewable Energy Usable (solar panels, dams, windmills) and Potential Fossil Energy Usable Waste
  • Electronics and Electronics Waste

As noted earlier, to execute a TRANSFORM, a country must have adequate input resources. For a country to TRANSFER resources to another country, the source country must have all the resources in hand. These requirements of adequate resources are called preconditions of the TRANSFORM and TRANSFER operations.

Representing a Virtual World

A virtual world state is a set of virtual countries, where each has amounts of various resources. You might choose to weight those resources, or not.

SampleResourcesThis represents sample weights for each resource. I have used abbreviated names, like R21 and R21′, but you will use more informative names like those above (e.g., population, timber).

An initial world state might include the following:SampleWorldImplicit in this illustration is that one set of resources weights apply to all virtual countries. We will make this assumption in Part 1, but you might relax this assumption in Part 2, reflecting the idea that different nations value a resource differently.

Sequences of Operations

Transfers and transforms will typically be done in sequence, as in the case of trades:

  • (TRANSFER ?Ci ?Ck ((Timber 25)))
  • (TRANSFORM ?Ck (INPUTS … (Timber 50)…) (OUTPUTS (Housing 10) …))
  • (TRANSFER ?Ck ?Ci ((Housing 5)))

This example indicates that ?Ci gives ?Ck Timber, ?Ck transforms Timber and other materials into Housing, and then ?Ck gives some Housing back to ?Ci. In this example, a package might omit the middle TRANSFORM, being agnostic about how ?Ck acquired the Housing to trade back (e.g., through manufacture, trade, or already in possession).

Your AI in parts 1 and 2 will correspond to one country, call it ‘self’ for now, and sequences that typically involve self will be found by your AI that presumably will benefit self. For example,

  • (TRANSFER ?Ci self ((Timber 25)))
  • (TRANSFORM self (INPUTS … (Timber 50)…) (OUTPUTS (Housing 10) …))
  • (TRANSFER self ?Ci ((Housing 5)))

In a fuller simulation, perhaps in Part 2, your AI might discover a sequence like that above for self and then pitch it to candidate other countries, ?Ci, to see if one might agree to the trade.

Resources that were traded back and forth would typically be disjoint, but there is nothing about the definition of TRANSFER that precludes resources being given, and then given back in whole or part. Even “waste” resources can be transferred, presumably with deleterious effects on the recipient (but in the real world a country can pay another country to offload its waste, say plastics).

Sequences can be arbitrarily long, implementing more sophisticated interactions.

  • (TRANSFER ?Ci ?Ck (…))
  • (TRANSFER ?Ck ?Cp (…))
  • (TRANSFER ?Cp ?Ci (…))
  • (TRANSFER ?Cp ?Ck (…))

In this example, ?Ci gives resources to ?Ck, which then transfers resources to ?Cp, which then distributes resources back to Ci and Ck. There may be TRANSFORMS or other trades too.

Back to Programming Project landing page