Sortal structures   Index

 

Characteristic individuals

The characteristic individual of a primitive sort defines its representational aspect, specifically, the representation of its individuals' data values and behavioral methods. It is specified in its class implementation.

Each characteristic individual also specifies a nil value or individual. When taking the complement of an individual with respect to another individual, or determining the common part of two individuals, the result may be empty or nil.

The following examples of characteristic individuals are currently available in the Python sortal library.

  • A point2D is a point in two-dimensional space, with discrete behavior.
  • A line2D is an unbounded line in two-dimensional space, with discrete behavior.
  • A lineSegment2D is a bounded (and half-bounded) line segment in two-dimensional space, with interval behavior.
  • A plane2D is an unbounded plane in two-dimensional space, with discrete behavior.
  • A planeSegment2D is a bounded, rectilinear plane segment in two-dimensional space, with areal behavior.
  • A circle2D is a closed circular curve in two-dimensional space, with discrete behavior.
  • A circularArc2D is a circular arc in two-dimensional space, with cyclical behavior.
  • An ellipse2D is a closed elliptical curve in two-dimensional space, with discrete behavior.
  • An ellipticArc2D is an elliptical arc in two-dimensional space, with cyclical behavior.
  • A bezierCurve2D is a quadratic Bezier curve in two-dimensional space, with interval behavior.
  • A point3D is a point in three-dimensional space, with discrete behavior.
  • A line3D is an unbounded line in three-dimensional space, with discrete behavior.
  • A lineSegment3D is a bounded (and half-bounded) line segment in three-dimensional space, with interval behavior.
  • A plane3D is an unbounded plane in three-dimensional space, with discrete behavior.
  • A planeSegment3D is a bounded, rectilinear plane segment in three-dimensional space, with areal behavior.
  • A circle3D is a closed circular (planar) curve in three-dimensional space, with discrete behavior.
  • A circularArc3D is a circular (planar) arc in three-dimensional space, with cyclical behavior.
  • An ellipse3D is a closed elliptical (planar) curve in three-dimensional space, with discrete behavior.
  • An ellipticArc3D is an elliptical (planar) arc in three-dimensional space, with cyclical behavior.
  • A bezierCurve3D is a quadratic Bezier curve in three-dimensional space, with interval behavior.
  • A label is an alphanumeric value with discrete behavior. An individual with empty value is considered nil.
  • A weight is a non-negative numeric value with ordinal behavior. An upper bound may be specified for a sort of weights. An individual with value 0 is considered nil.
  • An rWeight is similar to a weight, but where the complement of a weight wrt a smaller weight is the weight itself, the complement of an r-weight wrt a smalle r-weight is the numeric difference of both r-weights.
  • A numeric is a numeric value with discrete behavior.
  • An enumerative is a value from among an enumerated set, with special behavior.
    The specification of an enumerative sort requires the enumeration of the values as well as their mutual ranking. An enumerative sort supports the specification of qualitative aspects in "color grammars" (Knight 1989; 1993)1.
  • A color is a color value specified in RGB or HSV space, with special behavior.
    An additional argument may specify the kind of ordinal behavior, i.e., wether the sum of two color values is the average RGB value, the maximum RGB value, the sum of the RGB values, or defined as a function of the respective alpha values.
  • A description is compound data entity with discrete behavior. A description may contain tuples, strings, numbers and certain literals. When part of a description rule, a description may be parametric and contain expressions.
    A description sort supports the specification of description functions/grammars (Stiny 1981; Stouffs 2016a; 2016b)2.

Each characteristic individual is assigned a behavioral category that specifies the operational behavior of forms of corresponding individuals. More on behavioral categories

 

Examples

A primitive sort is defined by, at least, specifying its name and its characteristic individual. Some characteristic individuals additionally allow for the specification of one or more arguments, one or two require this.

  • A sort of (numeric) weights may have an upper bound specified. This upper bound constrains the possible values that may be given to individuals of this sort. For example, an upper bound of 255 may serve to consider weights as grayscale values (e.g., surface tones) between 0 and 255.
  • A sort of enumerative individuals requires the specification of the enumeration values as well as their mutual rankings. The enumeration values are specified as a set of identifiers, and their ranking as an array of enumeration values resulting from the addition of every combination of two values (ordered as a matrix, corresponding the original enumeration ordering). For instance, given an enumeration of black and white (in that order), a ranking array of black, black, black and white would mean black dominates white as any addition of two values, with the exception of white and white, results in black.
  • A sort of colors may take two arguments. The first specifies the color space, either RGB or HSV (or HSB). The default color space is RGB. The second argument specifies the particular behavior for adding two color values, either RGB_MAX (the maximum of the respective R, G and B values), RGB_SUM (the sum of the respective R, G and B values), RGB_AVG (the average of the respective R, G and B values), or RGB_ALPHA (a function of the respective alpha values). HSV color values are converted to RGB and back when adding two color values. The default behavior for adding two color values is RGB_MAX.

In SDL (Sortal Description Language) these sorts may be defined as follows:

sort tones : [Weight](255);
sort enum_colors : [Enumerative]({black, white},
                                 [black black black white]);
sort colors : [Color](RGB, RGB_ALPHA);

 

  1. T.W. Knight, 1989, Color grammars: designing with lines and colors, Environment and Planning B: Planning and Design 16(4), 417–449.
    T.W. Knight, 1993, Color grammars: the representation of form and color in design, Leonardo 26(2), 117–124.
  2. G. Stiny, 1981, A note on the description of designs, Environment and Planning B: Planning and Design 8(3), 257–267.
    R. Stouffs, 2016a, Description grammars: a general notation, Environment and Planning B: Planning and Design.
    R. Stouffs, 2016b, Description grammars: precedents revisited, Environment and Planning B: Planning and Design.
 
 
 

Last update: 2 December 2019, webmaster @ sortal.org