Project Description and Logistics

This project is motivated by the course catalog description and relevant ABET criteria. The project is somewhat open-ended, allowing teams to participate in the specification process, as well as design, implementation, and evaluation. The project requires integration of knowledge and skills learned in earlier CS courses, and ideally to use knowledge from other disciplines that team members will have studied as well.

The project is to build a multi-method AI that plans and models trading and development  (e.g., farming, manufacturing) decisions for respective virtual countries, each country with virtual resources and incentives for cooperating and competing with other countries. The project is broken into two parts. In Part 1 of the project, each team will work on a fairly well defined backbone for an AI agent (aka virtual country) that is simulating its potential actions in a simulated world. which include responses to the possible actions of other virtual countries. The specification of Part 1 still has gaps that each team must define. In part 2, which happens in the latter part of the semester, each team will continue the project, building in additional functionality for learning, game play, and game definition, modelling war, reasoning under uncertainty, with a great deal of team autonomy. The remainder of this page gives an overview of the simulation basic “rules”.

At the bottom of this page are links to more specifics on Part 1 and Part 2.

Simulation Definition

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

Resources are labeled as R_1, R_2, …, R_M. Countries are labeled C_1, C_2, …, C_N. Time steps are labeled T_1, T_2, …, T_final.

Basic Country Operations

There is one basic within-country action, TRANSFORM, which is a general template that can be parameterized in many ways.

  • (TRANSFORM C_i (INPUTS (R_1j X_1j) … (R_mj X_mj))  (OUTPUTS (R_1k Y_1k) … (R_mk Y_mk)), where INPUTS (i.e., various amounts (X_ij) of resources (R_ij) owned by C_i ) are changed (e.g., by manufacturing, by agriculture, by internal strife) into OUTPUTS (i.e., various amounts (Ylk) of resources, also owned by C_i). The resources that comprise the INPUTS and those of the OUTPUTS can overlap, indicating that a given input is not completely consumed, or is even increased by the TRANSFORM. Transformation templates restrict the kinds of transformations that can take place (e.g., a country cannot transform a combination of “coal” and “water” into “gold”), so we have to agree on them in advanced. Some product resources on a transform will also correspond to “waste” material, which is also represented as a resource, albeit typically undesirable.
  • An example of a TRANSFORM for creating Housing by any country is
(TRANSFORM ?C1 
           (INPUTS (AvailableLand 1)
                   (Population 5)
                   (Water 5)
                   (MetallicElements 1)
                   (Timber 5)
                   (MetallicAlloys 3)
                   (PotentialEnergyUsable 5))
           (OUTPUTS (Housing 1)
                    (HousingWaste 1)
                    (Population 5)
                    (Water 4)))

Our assumption is that this is a possible TRANSFORM for any country (i.e., any country can be bound to variable ?C1) if the country has the requisite inputs.

The nondivisible 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 amount in the TRANSFORM template is multiplied by 5 to achieve the desired operation

The primary between-country action is TRANSFER, which can also be parameterized in many ways.

  • (TRANSFER C_i C_k ((R_1j X_1j) … (R_mj, X_mj))) : C_i gives various amounts (X) of resources (R) to country C_k. These amounts are subtracted and added from the respective stores of resources in C_i and C_k. The TRANSFER of a list of resources is actually just shorthand for a list of one resource TRANSFERs, as shown below. That is there is no relationship between the amounts of different resources in a list.

The shorthand above can be written as a set of singleton transfers.

  • (TRANSFER C_i C_k ((R_1j X_1j))) 
  • (TRANSFER C_i C_k ((R_mj, X_mj))) 

For example, this TRANSFERs 3 Housing units from one country to another.

 (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 the subset transfers may be interspersed with transfers between other countries, and these interspersed transfers may interact with each other in a simulation. For part 1, use only singleton TRANSFERs, with composite TRANSFERs potentially being used in Part 2 to implement macro operators (more later).

Resources and Allowable Transformations

Resources are of various types. Some resources are “basic” or “raw” resources, and some resources are “created” (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. Initially (Part 1) we will consider all resources non-renewable, but teams can model renewal in Part 2.

In principle, some raw resources can be reclaimed from created resources, at least in part. Reclamation could be done through the TRANFORM operator, and there may be explicit waste associated with it, but “waste” can be implicit in that some of the original raw resources are lost (rather than an associated negative resource). Again, recycling can be modeled in Part 2 of the project.

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 — some can’t (e.g., analogs to solar power, land).

Some Sample Resources and Templates

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

Transformations must follow pre-established templates that outline the unit number of inputs that result in unit number of outputs. Actual transformation operations that follow these templates must have resource values that are proportional to the unit values given in templates (as noted when the transform operator was introduced above). <Note to self: Rewrite these transforms in notation above with INPUTS and OUTPUTS

Housing Template (as above)
(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)))

, where preconditions are of the form ?ARk <= ?C(?Rk), that is, the resources in possession of a country,  ?C(?Rk), is at least as large as the amount of that resource required for the transformation, ?ARk.

Representing a Virtual World

A virtual world state is a set of virtual nations, where each has amounts of various resources. We might represent a virtual world state with resources.

SampleResources

I have used abbreviated names, like R21 and R21′, but you will use more informative names like those immediately above.

An initial world state might be:

SampleWorldImplicit in this illustration is that one set of resources weights apply to all virtual nations. 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.

The Ranking of Countries (Sample only — you will create your own State Quality function)

The project requires that you measure the ‘quality’ of countries, where quality can be  based on amounts and proportions of selected resources possessed by each country. For example, a quality function could be a weighted sum of resources for each country, ?C, perhaps normalized by resources such as population and available land. All w_i below are positive (and waste resources are negated).

  • w_water * ?C(water)
    • or w_water * (1 – ?C(population)/?C(water)) in this latter case, if a country’s population is less than a country’s water then population <= water then (1 – ?C(population)/?C(water)) is non-negative value (water sufficient), else negative value
  • w_availableland * ?C(availableland)
    • or w_availableland * (1 – ?C(population)/(2 * ?C(AvailableLand)): … (land sufficient) ….
  •  … (energy sufficient) …
  •  … (housing sufficient) …
  •  … (food sufficient) …
  •  …
  • (-1 * w_electronicswaste) * ?C(electronicswaste)
    • or (-1 * w_electronicswaste) * ?C(electronicswaste)/(?C(population) (electronics waste load) ….

Packages of Operations

Transfers can be done as packages, as in the case of trade agreements.

  • (TRANSFER C_i C_k (RESOURCES (R_1j X_1j) … (R_mj, X_mj)))
  • (TRANSFER C_k C_i (RESOURCES (R_1l Y_1l) … (R_ml, Y_ml)))

which indicates that C_i gives C_k resources, and C_k gives C_i resources. These resources 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 transfered, presumably with deleterious effects on the recipient (but in the real world a country can pay another country to offload its waste, say plastics).

Packages of transfers can also be used to implement “alliances”. Two countries might collaborate to pool their resources so as to enable one country (the recipient) to make trades on behalf of itself and one or more other countries.

  • (TRANSFER C_i C_k (RESOURCES (R_1j X_1j) … (R_mj, X_mj)))
  • (TRANSFER C_k C_p (RESOURCES (R_1j Y_1j) … (R_ml, Y_ml)))
  • (TRANSFER C_p C_i (RESOURCES (R_1j Y_1j) … (R_ml, Y_ml)))
  • (TRANSFER C_p C_k (RESOURCES (R_1j Y_1j) … (R_ml, Y_ml)))

In this example, C_i gives resources to C_k, which then transfers resources to C_p, which then distributes resources back to C_i and C_k. There are other ways to write this, which in theory are equivalent.

A package can include TRANSFORM operators as well as TRANSFER operators. A package is represented as a <list of ops>), such as

(  
   (TRANSFER C_i C_k (RESOURCES (R_1j X_1j) … (R_mj, X_mj)))  
   (TRANSFER C_k C_i (RESOURCES (R_1l Y_1l) … (R_ml, Y_ml)))
)

X/Y (or Y/X) is the exchange rate or perhaps its weight as in w_ijkl(X/Y) or w_ij(X)/w_kl(Y).

SEE Project Part 1 Specifics

SEE Project Part 2 Specifics