Tagged: Primus2

0

Primus2\Falcraft: New Data Types (unordered/ordered node)

These data structures allow you to define parent and child relationships using a set of vertex information and classes. These are best suited to dealing with a tree of nodes, a common data structure encountered by optimization and artificial intelligence.

0

Primus2\Falcraft: New Data Type (leaf)

Many times in while programming you want to have a hierarchy of objects.  A hierarchy can very easily be realized as a ‘tree’ of parent elements and child elements.  This is not the only...

0

Primus2\Falcraft: New Pattern (abstract factory)

The abstract factory class in the link creates other abstract factories. This is much like the Enumeration data type which creates constants/enumerators with specific arguments. Each Abstract Factory is a throw-away object that you can use to create code dynamically for a given factory.

0

Primus2\Falcraft: New Data Type (map)

In PHP, keys in an array can only be a string or an integer.  However, in many general symbolic programming situations, you may want to be able to associate one piece of data with another.  You can establish a link between to pieces of data by setting one as a key and one as a value in an associative array.  The Map data type allows you to use any data type as a key and a value.

0

Primus2\Falcraft: New Design Pattern (publisher/observer)

One interesting note about these interfaces is that both the publisher and the observer include add and detach functions for the other.  Usually, observers only have a notify function.  Using both of these sets of functions is optional: the only set that must be implemented is on the publisher (to call the observer’s notify).

0

Primus2Falcraft: New Data Type (structure [typed])

This data structure mimics the C struct, sort of. A structure has specific fields to be taken care of or filled, some or all of these fields may have restrictions placed upon them. An object that falls under a particular genus may need to implement a specific interface, but contain modifiable members that need to be accessed generically.

0

Primus2\Falcraft: New Data Type (tagged union)

IMPORTANT This code is obsolete and has moved to another project, asherwunk/phabstractic.  For more information on the most recent version see the current blog post. Primus/Falcraft now has support for a tagged union data type....

0

Primus2\Falcraft: New Data Type (lists)

There are many different kinds of lists in computer programming.  Some of them act like heaps of data, some like grocery lines, some like unending rings.  Some lists you can only go forward in, some you can go backward as well.  Here are some lists that Primus/Falcraft implements.

0

Primus2\Falcraft: Registry Design Pattern

When you want to find an object you usually start with another object that has an association to it, and use the association to navigate to it. Thus, if you want to find all the orders for a customer, you start with the customer object and use a method on it to get the orders. However, in some cases you won’t have an appropriate object to start with.

0

Primus2\Falcraft: New Data Type (set)

In computer science, a set is an abstract data type that can store certain values, without any particular order, and no repeated values. It is a computer implementation of the mathematical concept of a finite set. Unlike most other collection types, rather than retrieving a specific element from a set, one typically tests a value for membership in a set.

0

Primus2\Falcraft: Identity Feature

The feature defines a static property for the using class.  This static counter remains unique on each poll for a new identity (in this case it’s an integer).  The $identityCounter must be ‘increasable’, that is, every time its accessed or ‘advanced’ it must be unique from all the identity values before it.  Counting up is a very easy way to accomplish this.

0

Primus2\Falcraft: Type Enumeration

IMPORTANT This code is no obsolete and does not reflect the new version, which has also moved to asherwunk/phabstractic.  You can see the current blog post. Primus2/Falcraft now has type detection and comparison using...

0

Primus2: New Data Type (enum)

I am proud to announce the addition of an enumeration data type to the Primus Artificial Intelligence Framework: Falcraft Module An enumeration is a set of values a variable can be specified as an array of constants.