Concepts (2.0.6)

Cameleon is a new free & open source language based on an abstract functional grammar & a glossary divided in specifics working fields dictionaries. The grammar is based on a petri net extension with a mathematical formalism described in Cameleon grammar, a petri net extension. The language can be edited graphically using the Cameleon Algorithm Editor to create Cameleon program, named composition. The language glossary can be extended with new fields dictionaries using the Cameleon Dictionary Development Kit (DDK) to create Cameleon dictionary, a collection of words, them-self named operators. Cameleon language aims to simplify & accelerate software development by using a high-level bottom-up approach.

With a simple drag & drop mechanism, you can create an image processing prototype where the calibration is done in real-time. In Caméléon creator, code is a graphical data(work)-flow interpreted and executed by the Caméléon Virtual Machine with a mathematical equivalence & a XML equivalence.

Before following tutorial or references to build your prototypes, you must know how to read the Caméléon language. To do so, you have to understand deeply Caméléon’s inner concepts.

An operator is an independent software component using input data x to produce output data y. An operator is like a mathematical function f, f(x) = y.
An operator has a graphical representation: a circle including its name and surrounded by little circles representing input (little circles including little black circles) and output (little circles including big black circles) datas.

Figure 1 – An operator and its equivalence

Note: It exists a functional equivalence between operator, mathematical function & computer science function. This is a good way to organize knowledge & know-how.

Little circles surrounding the operator represents input & output data and are named connectors. A connector hold a data and gives the ability to connect itself to another connector in order to share its data. All data has a type (NUMBER, STRING, IMAGE …).

Figure 2 – A first connection

An equivalence to Figure 2 is f(x)=y; g(y)=z.

Connection condition: You can only connect output connectors to input connectors with the same type or with a generic type. A connected connector cannot be connected to another connector.

A connection is represented by a line with an arrow showing the direction of the connection.

Figure 3 – A connection, a is shared to b

A control is an independent software component using input data x to produce output data y with a graphical user interface enabling the user to view and/or manipulate data. y=g(x), the function g is a human action.

Figure 4 – A control

Inputs and outputs data are representing by connectors as we do for the operator. Those connectors can be connected to operator’s connector.

Figure 5 – A control connection

It exists different kinds of controls.

Figure 6 – Controls

A dictionary is a separate Caméléon Editor plugin as a shared library offering several components (operator, control …) to enrich Caméléon Editor with new independent software component to play with.

Note: You can add your own C++ component dictionary using the Caméléon Development Kit. Generally, dictionaries addresses specifics business fields. For instance, Population Dictionary target image processing & analysis in material science.

A composition is a set of connected operators & controls combined to process specifics numerical tasks. It’s a computer program with a graphical representation. A composition is also named a prototype.

Figure 7 – A composition

A sub composition, or a sub process, is a set of connected operators & controls aggregate under a graphical grey element. It’s a graphical view to simplify & organize a composition. You can browse a sub composition and modify its content.

Figure 8 – A sub composition, outer & inner view

A pattern is a reusable sub composition. The pattern creation is the same as the operator creation. A pattern is represented by a *.pa XML file in the pattern directory of the Caméléon instance directory. This file is sharable and can be used in all Caméléon instance.

Figure 9 – Pattern & pattern directory

An interface is a composition composed exclusively by controls & managed by the controller window.

Figure 10 – Interface

A composition can be launched & stopped.

The execution is directed by inputs & outputs data. To know more about inner mechanics, please see the theory article.

Connectors as a status regarding its inner data: NEW (GREEN), EMPTY (GREY) or OLD (BLUE).

Figure 11 – Connectors statuses

Operator as a status regarding its execution: RUNNABLE (GREEN), NOTRUNNABLE (GREY), RUNNING (YELLOW), ERROR (RED).
An operator can only be runned if its execution condition, regarding connector statuses, is verified.

Figure 12 – Operator statuses

The standard execution condition is as follow:
* inputs datas are NEW or OLD with a minimum of one input at NEW,
* outputs datas are OLD or EMPTY.

Execution condition can be standard or specific to an operator. Please see the component specification & documentation (SCD, Population).

Figure 13 – A composition execution

For instance, on the Figure 13, at execution time, if X is NEW, f is executed and produce Y. Then Y is dumped into Y’, then g is executed and produce Z.

Figure 14 – An other composition execution

Note: At second execution of this part of the composition, the flow cardinality before & after h is disturbed. Cb < Ca. We need to synchronize the two h inputs with a synchronous operator with a different kind of execution condition.

Figure 15 – Yet an other composition execution

Merge doesn’t need a data available in the two inputs data to be RUNNABLE.
Study the merge documentation and understand that it exists different kind of execution condition. You have to master them if you want to create robust prototypes.

Update function.
if example

Some screen shots