3.5 Cellular Automata

Note: This is an excerpt from a draft of my thesis, A Computer Model of National Behavior. The introduction and table of contents
are also available

3.5 Cellular Automata

Cellular Automata (CA) attempt to model complex changing environments by assuming they are built up of large numbers of small units that hold values and follow simple rules. These units are called cells, in the simplest CA models a cell can store only a 0 or a 1, and these values can change as the system runs. More complex CA systems allow for much more information to be stored in each cell. Cells are arranged in grids, called latices, in any number of dimensions. CA were initially devised in the 1940s by John von Neumann, whose pioneering work in game theory has already been mentioned. Though some CA insights are used in this model, CA theory by itself fails to correctly model national behavior.

Nearly forty years after cellular automata theory was first proposed, Stephen Wolfram segregated all CA systems in to four classes based on their behavior. Class 1 cellular automata nearly always end in one unique state regardless of initial values. Class 2 leads to a series of patterns that repeat periodically or are stable. Class 3 is aperiodic and chaotic, constantly cycling between seemingly random patterns that are somewhat similar to the initial state. The last class, Class 4, usually lead to the extinction of all values in the system except possibly for a small number of cells.

The implications of these four classes to the behavior of nations is arresting. These four seem to cover all known political science theories. In linear theories, political history is going in one direction to a happy (Class 1) or sad (Class 4) end. Alternatively, time is strictly (Class 2) or loosely (Class 3) cyclical. Otheraspects of CA seem also to fit a national model. Nations occupy places, which might be simplified into cells. In this model nations follow simple rules, and rules are central to CA.

The last important feature of cellular automata is self-reproduction, which further argues in favor of CA approach. This reproduction would allow for generations of nations and the CA’s purposeful reproduction would seem to allow modeling many colonizations efforts. Nonetheless, CA theory fails as an appropriate paradigm for this model on several counts.

First, the lattices needed for CA are too restrictive. By definition they have to be regular, so the grid of cells has to follow a consistent design. However, the political landscape is not laid out this way. One region can have many neighbors, while another otherwise similar one can have only a few. For example, a very low resolution model of Europe might define each place to be a sovereign state. So then some places would have only one neighbor (such as The Holy See or San Marino), some might have two (such as Andorra) and some might have many (such as Slovakia). Though a counterargument can be made that this is an inappropriate scale, even this argument confirms that CA is inappropriate because it predefines what scales are appropriate.

Second, too much data would be stored per cell. Cells are not necessarily limited to boolean or numeric data, but the amount of data that would be needed is nonetheless far more than customary. Population, change in population, wealth, change in wealth, ideology, and other fields will need to be stored. These are only some of the fields stored in the relatively simple version of the model that will be attempted here. Successful CA systems are built on true simplicity, which is a goal perhaps out of reach of this approach.

Third, the CA concept of neighborhood is inappropriate for this model. A neighborhood is the collection of cells that are affected by any one cell, and neighbors are the cells affected by this one cell. Implementations can be different, but normally neighborhoods are defined to be a von Neumann neighborhood (the four cells above, below, to the left, and to the right of a cell) or a Moore neighborhood (which is a von Neumann neighborhood plus the four cells diagonal to the central cell).

medium_von_neumann_neighborhood.2.gif
Graphic 4. von Neumann Neighborhood
medium_moore_neighborhood.2.gif
Graphic 5. Moore Neighborhood

The concept can be expanded somewhat by saying that a cell can affect cells more than one cell away, and even by saying that the effect of a cell falls off with distance, but without significant modification this approach fails to be useful in modeling a complex system.

Advances in communications clearly illustrate this problem. Consider the modern United States of America. America can project maximum force evenly over the entire globe, and more subtle forces can be exerted that are almost as balanced. How would this be modeled in a CA system? First, as discussed above the scale would be inappropriate, and the country would have to be composed of many small cells. A less fine scale would not allow for true CA, because CA assumes that global results emerge from aggregate behavior of many small cells. There has to be a mechanism to allow for joint action. Provinces do not declare war, but the countries they are part of do. CA, by relying on cell-based decision making, does not allow for this. It might be possible to massage the CA model to allow for action like this, but it would go against the philosophy of CA and perhaps even be self-defeating.

Fourth, the CA approach would considerably complicate the modeling of the relationship between nations and places. Explained more fully in the section “Nations-in-Places,” this relationship rationalizes the interaction between nations and places. For a model of most of Europe a few hundred of these relations suffice. However, using a regular lattice thousands of cells will be needed just to create an accurate map of the contours of the continent. Trying to model this with CA would lead to an incredible amount of logic needed for any movement of time. Assuming a hundred cell by hundred cell grid, which seems the minimum for a continental simulation, this gives us ten thousand cells. For every movement, every neighborhood will need to change, and these changes will then have to be factored into the behavior of the nations themselves This might be a benefit if one needed to justify use of a supercomputer, but for a project that will need to complete in reasonable time on reasonable hardware the CA method is out of reach.

Fifth, CA would conflict with other goals of this simulation. Wolfram defines CA systems as “… simple discrete deterministic.” This collides with the objective of this study. Instead of modeling nations as complex living beings, simple rules and values would be used. Instead of modeling nations with fuzzy logic, whole values would have to be used. Instead of the unpredictability of free choice, the outcome of the model could be mathematically proven before it is even run.

For all of these reasons, CA is not currently appropriate as a tool for this model.

Computer Science Thesis Index

3.4 Game Theory

Note: This is an excerpt from a draft of my thesis, A Computer Model of National Behavior. The introduction and table of contents
are also available

3.4 Game Theory

Related to the earlier discussion of war and computer games, game theory is a heavily mathematical approach to rational conflict. Roger McCain states that “Game theory is a distinct and interdisciplinary approach to the study of human behavior. The disciplines most involved in game theory are mathematics, economics and the other social and behavioral sciences.”

The most promising aspect of game theory is that it models competition between rational actors. Spangler breaks game theory into three parts. The interaction can be for “zero sum,” “positive sum,” or “negative sum” games. In zero sum games, the gain of one can only come from the loss of others. In positive sum games, all players can end better off, while in negative sum games all of the players can end the game worse off. Lastly using formal game theory would allow rigorous examination of the model. However, ultimately game theory cannot be much used in the construction of the model adopted by this thesis.

Game theory closely examines competition. Questions such as “What is rational when not all information is known,” “How often is cooperation rational,” and “Are moral rules emerged from rational competition” are asked by the field. All of this is directly applicable to the model. To be valid, the model will have to model nations acting rationally, which is a direct concern of game theory.

Game theory’s applicability to zero sum and non zero sum games is also alluring. In the real world, nations fight wars where each side temporarily sacrifices its own long term growth in order to hurt even more the health of the other. However, many aspects of the real world are not like this. A growing world economy allows all nations to be wealthier than before, which allows them to support more people and have more absolute power. It would be very useful to use a formal guide such as game theory which has this flexibility built in to it.

The formal logic underlying game theory is also an advantage. Like any mathematical statement, a game can be evaluated for a value. It can also be logically tested to see if it is true or false. This would remove some subjectivity from the model, and open the door to further formal methods, such as Z or predicate calculus.

Sadly, this last benefit is also a significant drawback. It must be stressed that game theory is an advanced subdiscipline of mathematics. A comprehensive utilization of game theory would be more appropriate for a dissertation. It would require expertise beyond the scope of this project. Therefore, while the basic lessons of game theory should be remembered throughout this thesis and ensuing model, the use of the mathematics of game theory will not be incorporated into the model used in this thesis.

Computer Science Thesis Index

Life – or Vacation – in the Gap

Life – or Vacation – in the Gap

From most to least “Core”

  1. Cayman Islands
  2. Mexico [only saw touristy bits]
  3. United States Virgin Islands
  4. Barbados
  5. Puerto Rico
  6. Jamaica

The first two were the only places I never felt intimidated and never was begged.

In Caymans I felt downscale, which was a nice change of pace.

As to Mark’s comments about girls, one of the serving babes is Ultra-Hot Indonesian Girl. When Ultra-Hot Indonesian Girl enters the room, you want to shout “Everyone, shut up. Ultra-Hot Indonesian Girl has entered the room.” Even hotter than a Singaporean. Jet black stockings, jet black hair, regulation skirt. Now if only the official uniform was a bikini and cowboy boots…

In other news:

The ship has an wonderously large, young, and buxom latinita population.

And alcohol.

All is good.

3.3 Fuzzy Logic

Note: This is an excerpt from a draft of my thesis, A Computer Model of National Behavior. The introduction and table of contents
are also available

3.3 Fuzzy Logic

The field of Fuzzy Logic was invented by Lotfi Zadeh at the University of California at Berkeley in the 1960s in order to model languages, according to Kantowitz. Specifically, according to Kaehler, fuzzy logic was used “as a way of processing data by allowing partial set membership rather than crisp set membership or non-membership.” Below a general outline of fuzzy logic is given, and then the reasons why this approach fits modeling national behavior are explained.

In standard logic, a value exists on one and only one point on a number line. This is especially easy to visualize when working with discrete integers. For example, take the value “two.” In standard mathematics, this is identical to the concept of “two-ness.” Two has complete “two-ness,” and every other number has no “two-ness.” Graphically,

medium_non_fuzzy_logic.gif
Graphic 2. Non-Fuzzy Logic

Non-fuzzy math works especially well in discrete situations with a small number of possible values. However, what if the concept of partial set membership, or something being “somewhat two-like,” is allowed? In a situation like that, where 1.9 is “very two-like” and 1.1 is “barely two-like,” a graphical visualization might look like:

medium_fuzzy_logic.gif
Graphic 3. Fuzzy Logic

As in statistics, the area in the chart sums up to one. In this example the fuzziness forms as a triangle.

Fuzzy logic is especially useful when describing nations for several
reasons.

First, Fuzzy Logic overlaps nicely with the concept of nationality. Nations can exist to a lesser or greater extent in a place. The allegiance of people to a nation is fuzzy. For example, the “French” nation exists very strongly in Paris while less strongly in Lorraine and Provence. However, Paris is a cosmopolitan city where many languages are spoken, while Lorraine and Provence have their own sense of nationhood or national identity . In other words the allegiance or identification of people to a nation if fuzzy. It would make little sense to say that France is not in Lorraine or Provence, but nor is it fully there. Fuzzy Logic provides a way to model this.

Second, Fuzzy Logic has been used successfully in similar situations. Martínez-Miranda, Aldea, and Bañares-Alcántara modeled work teams as a collection of agents with attributes modeled by fuzzy logic. While in Martínez-Miranda, et al, the objective is to select employees for engineering, both scenarios rely on independent agents in a complex system.

Third, Fuzzy Logic also complements the system by making up for one of the drawbacks of the model. In another published paper on fuzzy logic, Benedicenti and others note the vexing problem that often “only subjective measures are available. Subjective measures are the most error prone.” However, in the same document it is realized that “[i]t is necessary to accept the possibilities of errors, and to find a way to minimize their effects on the model.” Benedicenti’s words on the advantages of fuzzy logic in ambiguous situations should be quoted in full:

The application of fuzzy logic has two advantages. First, it allows inaccuracy in measurements. Second, it can effectively cope with uncertain quantities, often expressed by means of linguistic terms such as “little,” “some,” or “a few.” By choosing appropriate rules, moreover, the modeler can incorporate in the model data coming from subjective sources without compromising the validity of the model.”

Fuzziness logic is very similar to probability. Bezdek et al describe the difference especially vividly. Imagine a thirsty traveler comes across twobottles, “K” and “M.” The liquid in K is “fuzzy” — the potability of the water is .91. The liquid in “M” is not, but the probability that its water is potable is .91. Which one should the wonderer drink?

The solution lies in the definition of fuzziness and probability. A fuzzy potability of .91 means it is .91 “fit to drink. In other words, it is 100% likely that very fit to drink but it is not perfectly so. Alternatively, a probability of .91 means something very different. In 91% of situations the water will be fit to drink. That is, in almost all situations it will have a potability of 1. But in the rest it will have a potability of zero.

K is swamp-water.
It is 91% likely that M is pure water, but 9% likely that it is
hydrochloric acid. The wise traveler would drink from K.

Given the similarity between fuzzy logic and probability, how is the distinction kept in the simulation? Fuzzy logic is used in a couple different ways. First, is is used to define categories. Then, it is used to evaluate the nature of attributes.

Fuzzy categories are defined using standard deviations. Once each simulation years many entity attributes are calculated for this use. These include fuzzy concepts such as nation aggressiveness and state incoherence. For each such attribute different five fuzzy categories are defined. These are labeled “Very High,” “High,” “Medium,” “Low,” and “Very Low.” Pseudocode for this process is below.

The first task is to calculate the count, sum of values, and sum of values squared. In pseudocode it may be presented as,

foreach entity_type

foreach entity_type.fuzzy_attribute

foreach entity_type.member

with entity_type.fuzzy_attribute

.count
:= .count + 1
.sum
:= .sum + entity_type.member.value.fuzzy_attribute
.sumsq
:= .sumsq + entity_type.member.value.fuzzy_attribute ** 2

end with

next

next

next

This information will be used to calculate the standard deviation, and from there to create the fuzzy objects. The fuzzy categories for each fuzzy attribute are defined by a center point and a deviation. The more moderate, the closer to the center point and the less the deviation. This reflects the stabilization affect of moderation and the erratic nature of extremism. In pseudocode it may be written as,

foreach entity_type

foreach entity_type.fuzzy_attribute

with entity_type.fuzzy_attribute

center
:= .sum / .count
stddev
:= sqrt(.sumsq / .count – ( .sum / .count) ** 2 ) )
.VLow
:= new fuzzyCategory(center – stddev * 2 , stddev * 2.0)
.Low
:= new fuzzyCategory(center – stddev , stddev * 1.5)
.Moderate
:= new fuzzyCategory(center , stddev )
.VHigh
:= new fuzzyCategory(center – stddev , stddev * 1.5)
.High
:= new fuzzyCategory(center + stddev * 2 , stddev * 2.0)

end with

next

next

The constructor simple defines the center and deviation for each fuzzy category.

Perl lacks a solid publicly available fuzzy logic module. This required more coding than with other languages, and made code less abstracted that would be preferable. In particular comparison functions had be to written to implement fuzzy comparison.

Attributes of objects are compared against these fuzzy categories. For example, take the following example of testing to see whether a nation disintegrates. The pseudocode is,

foreach nation

if
nation’s polarization is greater than “very high polarization”
and
nation’s health is less than “very low health”

splinter nation

end if

next

In the above example, disintegration occurs when a nation is polarized between extremes and very unhealthy. These are both fuzzy concepts –polarization and and health both in a continuum. Both the categories and entity attributes are fuzzy, and cannot be given any one precise value. Physically, the numbers are compared using the mean and deviation declared. Abstracted, a fuzzy, or “subjective” objective, judgment is made comparison the nation’s health with the category of very high health.

Fuzzy logic proved invaluable as a method of working with values that are not definite. The use of a language with a fully supported fuzzy logic component would assist this project even more.

Computer Science Thesis Index

3.2 Object-Oriented

Note: This is an excerpt from a draft of my thesis, A Computer Model of National Behavior. The introduction and table of contents
are also available

3.2 Object-Oriented

Joines and Roberts write, “the real limits on the future adoption of simulation may rest on our ability to represent complex systems and to do it easily….” These needs are best met by an object-oriented approach. Object-Oriented (OO) programming is most appropriate paradigm for building the system for the reasons listed below. These include both OO’s own benefits and the failings of the main alternative, procedural programming.

The authors note that “[there] are several fundamental problems with using the procedural style of modeling and simulation.” One, “[procedures] do not correspond to real world components. Instead, they correspond to methods and algorithms.” Without OO a separate layer of abstraction would somehow need to be added to prevent code confusion. This limitation has led to many simulations being queue networks, as this is most appropriate in a procedural setting. Likewise, even if this abstraction layer can be written in code,“[t]hese mechanisms are vulnerable to inappropriate use and [are] dangerously visible to users.” In an academic settings this is less because of code security than clearly defining levels of abstraction. If a student is constructing a model of Europe , it would be inappropriate for him to have to simultaneously deal with the details of how the objects are implemented in code.

Another fault of procedural programming would significantly impair future development. Joines and Roberts state:

“Perhaps the greatest limitation of the procedural style is its lack of extensibility. From the earliest simulation languages until the early 1990s, the only way to adapt these simulations was through functional extension. In other words, you could add structural functionality to the simulation but not alter any of its basic properties, like giving properties to resources… Specifically, [there] is no way to partially hide implementation details and were forced to give access to source code or restrict the access to the features.”

OO programming, however, offers numerous features. OO style also encapsulates the modeled objects, so that the manner in which something is accomplished is intentionally invisible to the programmer. Objects can pass messages to each other, either by manipulating each others properties, calling each others methods,affecting global variables, or in more advanced ways involving pointers, which are the physical address of objects. OO also allows for “inheritance,” where one type of object can be formed from another, thus avoiding many potential errors and long hours of coding.

Finally, OO design avoids the mentioned problems of procedural coding. Objects directly corresponds to the real world entities being modeled. This is done by first conceptually selecting the entities that will be studied, say foxes and hens in a barnyard simulation, and then creating fox and hen objects with the appropriate methods and properties. OO code does not have to worry about a general code or abstraction layers.

Computer Science Thesis Index