The new Icobjs The new Icobjs Framework Framework Christian Brunette Christian Brunette INRIA/ENSMP - MIMOSA INRIA/ENSMP - MIMOSA
Icobjs in the past Icobjs in the past Icobjs Icobjs u Means Means “ “Iconic Objects Iconic Objects” ” u u Is a means to build at runtime entity Is a means to build at runtime entity u behaviors by graphical combination behaviors by graphical combination u Based on Junior, a Java API Based on Junior, a Java API u
Problems Problems Behavior Object Atomic actions Operator 1 Operator 2 Operator 3 u The data structure was totally sealed The data structure was totally sealed u (basically due to OO approach) (basically due to OO approach) u There were no clear API of an icobj There were no clear API of an icobj u
Needs Needs u A clear API A clear API u u A means to modify icobj behaviors A means to modify icobj behaviors u after graphical construction after graphical construction u A means to save created simulations A means to save created simulations u and created icobjs and created icobjs u Some new instructions Some new instructions u u Some optimizations of the reactive Some optimizations of the reactive u engine engine
Outline Outline u The model The model u u The reactive engine The reactive engine u u The framework The framework u u Experimentations Experimentations u
Icobjs model Icobjs model u An icobj is a graphical reactive entity An icobj is a graphical reactive entity u composed of: composed of: – 2 identifiers: one for the entity and one 2 identifiers: one for the entity and one – for its “ “container container” ” for its – Graphical information: appearance and Graphical information: appearance and – space taken in its “ “container container” ” space taken in its – Behavior information: Cloneable and Behavior information: Cloneable and – not-Cloneable not-Cloneable – A A hash table hash table to store other fields to store other fields –
Some advices Some advices u Initialize Icobj fields with their Initialize Icobj fields with their u behaviors behaviors u Access Icobj fields only through Access Icobj fields only through u atomic actions atomic actions u Do not keep states in atomic actions Do not keep states in atomic actions u use Icobj fields Ë use Icobj fields Ë
Workspace Workspace “Workspaces are to icobjs what reactive Workspaces are to icobjs what reactive “ machines are to reactive instructions” ” machines are to reactive instructions Is the container of icobj Is the container of icobj u u Executes icobj behaviors u Executes icobj behaviors u Manages the graphical part u Manages the graphical part u Deals with interactions with “ “external external u Deals with interactions with u world” ” (end-user, network (end-user, network… …) ) world Events are local to the Workspace u Events are local to the Workspace u Is an icobj Is an icobj u u
Migration Migration u Migration = Migration = u exiting + transferring + entering exiting + transferring + entering u Two kinds of migration: Two kinds of migration: u – Local = from a local workspace to Local = from a local workspace to – another one (same thread) another one (same thread) – Through the network (different threads) Through the network (different threads) – u Need to wait the end of instant Need to wait the end of instant u u Take at least one instant Take at least one instant u
Outline Outline u The model The model u u The reactive engine The reactive engine u u The framework The framework u u Experimentations Experimentations u
Reactive engine Reactive engine u Junior instructions: Junior instructions: u – Nothing, Stop, Nothing, Stop, Seq Seq, Par, Loop, Repeat, If , Par, Loop, Repeat, If – – Await, Generate, Until, Control, Await, Generate, Until, Control, – Freezable, Local, When Freezable, Local, When – Link Link – u Based on the Storm implementation Based on the Storm implementation u of Junior (J-F Susini Susini) ) of Junior (J-F – 4 status: SUSP, TERM, STOP, WAIT 4 status: SUSP, TERM, STOP, WAIT – – “ “zap precursor zap precursor” ” algorithm algorithm –
Added Instructions Added Instructions u Run Run: evaluates at runtime and : evaluates at runtime and u executes a reactive program executes a reactive program ex: local migration ex: local migration u Scanner Scanner: executes an atomic action : executes an atomic action u associated to each occurrence of a associated to each occurrence of a valued event valued event ex: interactions with “ “external world external world” ” ex: interactions with (mouse, keyboard… …) ) (mouse, keyboard
Added Instructions Added Instructions u Kill Kill: weak preemption (SL) : weak preemption (SL) u – More regular/modular than the Until More regular/modular than the Until – instruction in Junior instruction in Junior – Until still exists Until still exists… … – u IcobjThread IcobjThread: : u – add new instructions dynamically to the add new instructions dynamically to the – dedicated icobj dedicated icobj – make the remove/migration of icobj make the remove/migration of icobj – behaviors faster behaviors faster
Engine modification Engine modification u LONGWAIT LONGWAIT: : u – New instruction status New instruction status – – inter-instant waiting inter-instant waiting – u SeqN/ParN SeqN/ParN: : u – one control of sequential/parallel one control of sequential/parallel – instructions instructions – to clean terminated instructions to clean terminated instructions –
Event management Event management u An event is added to the environment when: An event is added to the environment when: u – It is generated (internally or externally) It is generated (internally or externally) – – An instruction waits for it An instruction waits for it – u Keep events and values during 2 instants Keep events and values during 2 instants u after their generations after their generations u Need a mechanism to remove unused events Need a mechanism to remove unused events u from the environment from the environment – Faster event search Faster event search – – Less memory used Less memory used –
Outline Outline u The model The model u u The reactive engine The reactive engine u u The frameworks The frameworks u u Experimentation Experimentation u
Behavior inspector Behavior inspector u To inspect the behaviors of icobj To inspect the behaviors of icobj u u No direct access to instructions No direct access to instructions u executed in the reactive engine executed in the reactive engine u No modification during a reaction No modification during a reaction u u Change behaviors after construction Change behaviors after construction u – Changing the behavior fields of icobj Changing the behavior fields of icobj – – Removing the executing behavior from Removing the executing behavior from – the reactive engine the reactive engine – Loading the new behavior Loading the new behavior –
Introspection Introspection u Allow to modify values of icobjs fields Allow to modify values of icobjs fields u at runtime at runtime u Fields are only changed between two Fields are only changed between two u reactions reactions u User must implements on each icobjs User must implements on each icobjs u Field class: Field class: Paremeter[] [] getParemeter(Icobj getParemeter(Icobj self) self) Paremeter Serializable Serializable getValue(String getValue(String fieldName fieldName) ) void setValue(String void setValue(String fieldName fieldName, , Serializable Serializable value) value)
Load/Save Load/Save u Load/save Load/save = = migration migration u u Saving = Saving = u exiting + serialization in a file exiting + serialization in a file u Loading = Loading = u deserialization + entering deserialization + entering u These operations are controlled by These operations are controlled by u the Workspace the Workspace
Outline Outline u The model The model u u The reactive engine The reactive engine u u The framework The framework u u Experimentations Experimentations u
Experimentation (1) Experimentation (1) u Physics (cf. A. Physics (cf. A. Samarin Samarin) ) u – a physical reaction = 2 engine reactions a physical reaction = 2 engine reactions – one instant to gather all physical events u one instant to gather all physical events u one instant to compute the result u one instant to compute the result u – behaviors synchronized by an event behaviors synchronized by an event – – Remaining problems Remaining problems – loss of precision: due to data types u loss of precision: due to data types u not very modular: the computation has not u not very modular: the computation has not u to exceed one instant to exceed one instant
Recommend
More recommend