1 / 33

# Power Point - PowerPoint PPT Presentation

About the Use of Correlations in Component Based Frameworks. Georg Jung [email protected] Department of Computing and Information Sciences Kansas State University. Why Using Correlators?. Consider the following situation:. Component C is receiving from two components A and B

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Power Point' - jana

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### About the Use of Correlations in Component Based Frameworks

Georg Jung

Department of Computing and Information Sciences

Kansas State University

Consider the following situation:

• Component C is receiving from two components A and B

• A and B send at different rates

• C needs both inputs to become active

A

a

C

ab

b

B

correlations to

the infrastructure

Consider the following situation:

We can:

• Reduce network traffic

• Simplify computation inside the component

• Clarify the design

• Define the components in a more general way

A

a

a + b

C

ab

b

B

A

C

B

Scenario:

Example scenario from introduction slides:

• Three Components A, B, and C

• A and B send at different rates

Filter

Transformer

φCcorrelation HelloWorld

(φAa, φBb)

a + b

{

case true:

push new φC { x := a.data,

y := b.data }

}

Filter

Stream of incoming events

Transformer

e1 e3 e1 e2 e2

Conceptually, the correlator divides into two distinct phases:

• The Filter

• The Transformer

Reacting to a

detected pattern

• which events arrived

• what data is present

Filter

Transformer

Generates new output events

eout eout

Detection of

event patterns

And performs internal actions

• which events arrived

• what data is present

φCcorrelation HelloWorld

(φAa, φBb)

a + b

{

case true:

push new φC { x := a.data,

y := b.data }

}

In this simple example

the transformer does

a type conversion!

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

Scenario:

Components A and B carry out a task and deliver the results to C.

Component C expects the results to come in first from A, then from B.

The resulting race condition between

A and C can be caught with a

correlator.

Solution:

φdatacorrelation CatchRacing (φdata a, φdata b)

a + b

{

case true:

push a;

push b;

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

Scenario:

A component C receives from A and B.

a + b

when both events arrive, C wants the most recent (earliest) of both forwarded.

We change the filter expression to:

la:(a ; b) | lb:(b ; a)

φDatacorrelation First

(φData a; φDatab)

la:(a; b) | lb:(b; a)

{

case la: push a;

case lb: push b;

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

Consider the following filter expression:

(a + b) | (a + c)

And the following streams:

matches: a + b

a b a a c c …

matches: a + c

a c a b b a …

matches: a + b

and a + c

c b b c a a …

l1:(a + b) | l2:(a + c)

(a + b) | (a + c)

l1:(a + b) | l2:(a + c)

Transformer 1: Send a general notification

{

case true: push new φnote{};

}

l1:(a + b) | l2:(a + c)

Transformer 2: Send two outputs

{

case l1: push b;

case l2: push c;

}

l1:(a + b) | l2:(a + c)

Transformer 3: Send one output, with

priority on b if present.

{

case l1: push b;

case l2 & !l1: push c;

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

We consider three subexpressions x1, x2, x3. x2 shall not interleave between x1 and x3.

x1 ; (l2:(x2 ; x3) | l3:x3)

φcorrelation Interleaving (...)

x1 ; (l2:(x2 ; x3) | l3:x3)

{

case l2: push some error event;

case l3 & !l2: pushsome success event;

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

+

An

A3

A2

A1

Consider an array of redundant components

A1, A2,…, An.

and a single receiving component B,

interested in the accumulation of all events

a1, a2,…, an.

The filter expression is then

a1 + a2 + … + an

B

+

An

A3

A2

A1

a1 + a2 + … + an

In a component system some components

can be temporarily unavailable!

If one component does not send anymore

the whole pattern is never satisfied!

B

C

An

A3

B

A2

A1

Notify correlation SensorArray

(Notify a1, …, Notify an,

Control c1, …, Control cn)

l1:a1 + … + ln:an || m1:c1 || … || mn:cn

{ case l1 & … & ln: push new Notify {}

case m1: toggle l1

case mn: toggle ln

}

Sensor

Array

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

Scenario:

This scenario generalizes the previous. Instead of single devices to switch on or off, we have a several modes to chose from.

The same mechanism is used

to switch between modes

as previously to switch the

different devices on and off.

n filter expressions, labeled with n labels:

m1:e1 || … || mn:en

n labeled control events:

l1:c1 || … || ln:cn

φoutcorrelation Modal3

(φc c1, φ c c2, φ c c3, arguments for ei…)

m1: e1 || m2: e2 || m3: e3 ||

l1: c1 || l2: c2 || l3: c3

{

abort (m2, m3);

clauses for e1, e2, e3…

case l1: revive (m1); abort (m2, m3);

case l2: revive (m2); abort (m1, m3);

case l3: revive (m3); abort (m1, m2);

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

Scenario:

We introduce a periodic supervisor component into an aperiodic system.

Whenever a clock-tick occurs, a sample is collected and sent to the supervisor.

φsamplecorrelation PeriodicChck

(φtimer t, φaa, φbb, φcc)

t ; (l1:(a + b + c) | l2:t)

{

case l1:

push new φsample{d1 := a.data,

d2 := b.data,

d3 := c.data }

case l2:

push some error event (missed sample);

}

This presentation will include:

• How to prevent a race condition

• How to chose the most recent/earliest in a sequence

• How to handle a double match

• How to catch interleaving events

• How to deal with redundant-device-components

• How to introduce mode-dependent behavior

• How to bridge the gap between periodic and aperiodic systems

These are our examples.