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