Link Search Menu Expand Document

Class cvebehavior

About :

	A behavior is an abstract class of the virtual world defining a usage rules of evolution of the virtual world Two main subclass inherits from behavior : cveserver : defined in another package. It is a controler that receive events from other behaviors and who is in charge to propagate world evolution towards every other controler cvedevice : it refers a external system that shares somes state value and is able to receive event and to send event about the evolution of theses state values A behavior refers : subobjects : objects subbehaviors
Class diagram of class of cvebehavior.

Functions

Function summury
__init__(self, classifier=None, sub_maintain=False)  
refresh_referenced_uid(self, inserted=None, father=None, item=None) made to maintain a dictionnary of subuids and a dictionnary of fathers for (more…)
get_referenced_uid(self, uid, inpluginmodules=True)  
get_subgraph(self, obj, disconnected=True, SET=None) Taking an object as entry point, search all the corresponding subgraph (more…)
subgraph_buffer(self, item)  
print_referenced_uid(self, uid)  
check_referenced_uid(self, fathers)  
get_sub_uids(self) Returns the list of subuids rebuilt from scratch : valid for any behavior where this list is not maintained (more…)
is_component(self, obj, dev) Method to test if an object is contained in the subgraph of dev (more…)
exported(self)  
set_value(self, args, attached_files=[])  
set_value_ref(self, args, attached_files=[]) set a value (more…)
build_shared_files(self, item, io=None, references={})  
insert_item(self, args, attached_files=[], io=None) insert a list into a subnode (more…)
remove_item(self, args) remove an item from a list (more…)

Methods desciption :

init

def __init__(self, classifier=None, sub_maintain=False)

refresh_referenced_uid

def refresh_referenced_uid(self, inserted=None, father=None, item=None)

made to maintain a dictionnary of subuids and a dictionnary of fathers for

  • the server and the direct devices within the subbehavior attribute
  • the connectors (cveconnector and cverequester)
  • this new version works if it is called —–without any parameter then subuids and fathers are fully renewed in this case inserted == None —–with a father an item arg where item was inserted inside father if inserted==True and removed from father if inserted==False

get_referenced_uid

def get_referenced_uid(self, uid, inpluginmodules=True)

get_subgraph

def get_subgraph(self, obj, disconnected=True, SET=None)

Taking an object as entry point, search all the corresponding subgraph

  • → obj : the handle of the subgraph to insert
  • → disconnected : keep only disconnected subnodes
  • → SET : a set of nodes already identified as new: default None is equivalent to a void set.
  • ← SET : an updated version of SET

subgraph_buffer

def subgraph_buffer(self, item)
def print_referenced_uid(self, uid)

check_referenced_uid

def check_referenced_uid(self, fathers)

get_sub_uids

def get_sub_uids(self)

Returns the list of subuids rebuilt from scratch : valid for any behavior where this list is not maintained

is_component

def is_component(self, obj, dev)

Method to test if an object is contained in the subgraph of dev

exported

def exported(self)

set_value

def set_value(self, args, attached_files=[])

set_value_ref

def set_value_ref(self, args, attached_files=[])

set a value args = ( objuid,attribute,atkey,value ) objuid : uid of the node attribute : concerned subnode atkey : when node attribute is supposed to be a dictionnary value : new value returns a boolean for done the item which was set and the subitem if value is an item

build_shared_files

def build_shared_files(self, item, io=None, references={})

insert_item

def insert_item(self, args, attached_files=[], io=None)

insert a list into a subnode args = ( objuid,attribute,itemuid,atkey,newitem ) objuid : uid of the node attribute : concerned subnode itemuid : inserted subuid atkey : when node attribute is supposed to be a dictionnary

remove_item

def remove_item(self, args)

remove an item from a list args = ( objuid,attribute,itemuid,atkey ) objuid : uid of the node attribute : concerned subnode itemuid : removed subuid atkey : when node attribute is supposed to be a dictionnary