Link Search Menu Expand Document

Package Core api: cve.vmodel

Import instruction :

import cve

About :

The vmodel package is the core model of CVE (Collaborative virtual environment).

(Copyright (c) 2010-2013 G-SCOP Fr. Noël. All rights reserved).

It enables the management of a graph, based on vitem objects (nodes) and vstate objects (values). A vitem has various attributes which are officially exported by the exported method which defines the interface of the node, ie: its attributes.

Every other classes are either subclass of vitems or vstate and support to add semantic to the nodes and their attributes. The cveclassifier is a template for cveitems.

Main class diagram

Classes

Class summury
CveLog  
cveattribute This class is a node which describes an attribute in a meta model defintion
cvebehavior A behavior is an abstract class of the virtual world defining a usage rules of evolution of the virtual world
cveclassifier  
cvedevice  
cveitem This class defines nodes of the graph which will have states.
cvemethod This class is a node which describes a method for instances of a given classifier
cvepackage This class is a node defining a package (collection) of nodes
vboolean a boolean state
vcolor a color state : it refers a four value tuple : red, green, blue, opacity. Every value betwen 0. and 1.
vfile a string state refering a path to a file
vint an integer state
vitem The virtuel model is a graph of nodes and links between nodes
vliste a list of uid state
vreal an real state
vstate abstract class for defining the states of cveitem
vstring a string state
vtransform a transformation state : it refers an homogeneous matrix
vvector a vector of real

Functions

Function summury
line_number(cutname=True) line number within the current line number (more…)
Value2StringOrStringlist(value=None, stype=’’, item=None, atname=None)  
arguments()  
build_plugged_references(REF={})  
classifier_device(name=’DEVICENAME’, role=’CVEROLE’, rep=’filepath’, frequency=0.01)  
classifier_item(name=’ITEMNAME’, rep=’filepath’)  
create_fix_uid(modelname, itemname, domain)  
create_plugin(name=’’, PACKS=[], dirname=None, depends=[]) create a plugin : (more…)
create_uid(name, meta_model_name, domain=’@g-scop.grenoble-inp.fr’) create a unique uid based on name and meta-model name (more…)
cryptnewlineinrule(rule)  
cve_interfaces()  
cveguiratio()  
drst(msg=’’, *args)  
dtop(msg=’’, *args)  
duration_print()  
duration_reset(name)  
duration_start(name)  
duration_stop(name)  
finalise_event_template(event_name=’’, args=[], attached_files=[]) template for finalise event functions (more…)
find_by_uid_in_plugged_modules(uid=None)  
find_classifier_in_plugged_modules(classifiername=None, classtype=None)  
find_plugin_item(uid=None)  
get_cache(subdir=None)  
get_config(subdir=None)  
get_plugin_dependencies(plugin)  
get_plugins()  
get_plugins_dir()  
get_root(subdir=None)  
hide_plugin_dependencies(plugin)  
home_plugin_dir()  
init_methods_from_shared_files(x, DONE=None) (more…)
interface()  
issame(ev1, arg1, file1, ev2, arg2, file2)  
item_from_shared_files(itemuid=None, attached_files=[], io=None, references={})  
line_number(cutname=True) line number within the current line number (more…)
line_number(cutname=True) line number within the current line number (more…)
load(filename, plugin=False)  
load_plugins()  
load_plugins_from_dir(plugdir, ref=True)  
load_single_plugin(plugdir, filename=’’)  
move_cache(val)  
new(classifier=None)  
new_instance_of_class(classifiername=None, classtype=None)  
new_instance_of_classifier(classifier=None) as the previous one but a classifier uid is provided (more…)
package_classifiers(pack, L=[])  
plugin_retrieve(modelname)  
plugins_classifiers()  
python_engine()  
read_dependencies(dirname=’’)  
retrieve_plugin_dependencies(plugin)  
save_as(what=[], filename=’unnamed.cve’, force_replace=False)  
set_event(theobject, attribute, value=None, atkey=None)  
sort_dependencies(L=[], DEP={}) Description: Sort plugins based on dependencies. (more…)
start_device(argv, PLUGIN_ROLE, classruntime, lstart=[])  
start_device_runtime(cvedevice, runtime, daemon=True)  
top(message, *args) print a message and the interval of time between a list of times (more…)
uncryptnewlineinrule(rule)  
update_dependencies(DEP={}, name=’’, depends=[])  
write_dependencies(dirname=’’, DEP={})  

Functions details

line_number

def line_number(cutname=True)

line number within the current line number

  • ← a string printing the current line number and file name

create_plugin

def create_plugin(name='', PACKS=[], dirname=None, depends=[])

create a plugin :

nam : plugin name PACKS : list of package: must contain devices and packages dirname : where to write the plugin file depends : list of dependence packages.

create_uid

def create_uid(name, meta_model_name, domain='@g-scop.grenoble-inp.fr')

create a unique uid based on name and meta-model name

  • →: name of the class or object
  • →: model name
  • →: domain, specific domain name
  • ← a unique string

finalise_event_template

def finalise_event_template(event_name='', args=[], attached_files=[])

template for finalise event functions add self for class methods def finalise_event_template(self,event_name=’‘,args=[],attached_files=[]):

init_methods_from_shared_files

def init_methods_from_shared_files(x, DONE=None)

line_number

def line_number(cutname=True)

line number within the current line number

  • ← a string printing the current line number and file name

line_number

def line_number(cutname=True)

line number within the current line number

  • ← a string printing the current line number and file name

new_instance_of_classifier

def new_instance_of_classifier(classifier=None)

as the previous one but a classifier uid is provided

sort_dependencies

def sort_dependencies(L=[], DEP={})

Description: Sort plugins based on dependencies. Parameters: - L (list): plugins to sort.

  • DEP (dictionnary): key is dependent on the values. Return : - LS (list): sorted plugins list.

top

def top(message, *args)

print a message and the interval of time between a list of times

  • message : Introduction message
  • *args : an unlimite list of augmented times

Table of contents