Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hekate:heart_howto [2011/09/29 11:21]
kkr
hekate:heart_howto [2013/04/16 15:15]
esimon [Protocol commands]
Line 140: Line 140:
   - **[model,​remove,​ +modelname, +username].** - removes a model specified by modelname and username. After successful deletion fo the model <​code>​[true]</​code>​ is returned. In case of an error, following error message is sent back to the client<​code>​[false,'​Error while deleting model.'​]</​code>​   - **[model,​remove,​ +modelname, +username].** - removes a model specified by modelname and username. After successful deletion fo the model <​code>​[true]</​code>​ is returned. In case of an error, following error message is sent back to the client<​code>​[false,'​Error while deleting model.'​]</​code>​
   - **[model,​run,​ +modelname, +username, +{ddi | gdi | tdi | foi}, +tables, +{statename | statedef} ].** - runs inference process for the specified by specified model in one of the four modes, ddi, gdi, tdi or foi for given tables (schemas) - (see [[gox/3]] for details). State from which the inference should start can be either a name of the state that is located in HMR file, or a full definition of the state. The full definition of the state (statedef) should look as follows: <​code>​[[attribute_name1,​ value],​[attribute_name2,​ value] ... ]</​code>​ If the inference process succeed, the following answer is sent back to the client:<​code>​[true,​system_state,​ system_trajectory]</​code>​ The system_state is final state of the system defined as statedef. The system trajectory is a list of rules that were fired in the form of <​code>​[schema_name,​rule_id,​schema_name,​ rule_id, ...]</​code>​ If there is an error during this procedure, the following error message will be sent back to the user: <​code>​[false,'​Error occurred while running model'​]</​code>​   - **[model,​run,​ +modelname, +username, +{ddi | gdi | tdi | foi}, +tables, +{statename | statedef} ].** - runs inference process for the specified by specified model in one of the four modes, ddi, gdi, tdi or foi for given tables (schemas) - (see [[gox/3]] for details). State from which the inference should start can be either a name of the state that is located in HMR file, or a full definition of the state. The full definition of the state (statedef) should look as follows: <​code>​[[attribute_name1,​ value],​[attribute_name2,​ value] ... ]</​code>​ If the inference process succeed, the following answer is sent back to the client:<​code>​[true,​system_state,​ system_trajectory]</​code>​ The system_state is final state of the system defined as statedef. The system trajectory is a list of rules that were fired in the form of <​code>​[schema_name,​rule_id,​schema_name,​ rule_id, ...]</​code>​ If there is an error during this procedure, the following error message will be sent back to the user: <​code>​[false,'​Error occurred while running model'​]</​code>​
 +  - **[scheme, get, +modelname, +username, +schemeName].** - returns scheme of a given name in aform of:<​code>​[true,​[[INPUT_ATTRIBUTES],​[OUTPUT_ATTRIBUTES]]]</​code>​
   - **[state, add ,​+modelname,​ +username, +statename, +statedef ].** - adds new state to specified model. The statedef is full state definition in a form of: <​code>​[[attribute_name1,​ value],​[attribute_name2,​ value] ... ]</​code>​ The statename is a Prolog string.   - **[state, add ,​+modelname,​ +username, +statename, +statedef ].** - adds new state to specified model. The statedef is full state definition in a form of: <​code>​[[attribute_name1,​ value],​[attribute_name2,​ value] ... ]</​code>​ The statename is a Prolog string.
   - **[state, remove, +modelname, +username, +statename ].** - remove a state from specified model. If the operation succeeds following message is sent back to the client: <​code>​[true]</​code>​. In case of an error, the following message is sent back: <​code>​[false,'​Error while deleting model.'​]</​code>​   - **[state, remove, +modelname, +username, +statename ].** - remove a state from specified model. If the operation succeeds following message is sent back to the client: <​code>​[true]</​code>​. In case of an error, the following message is sent back: <​code>​[false,'​Error while deleting model.'​]</​code>​
Line 151: Line 152:
  
 ==== Protocol examples ==== ==== Protocol examples ====
-  - Adding a model <​code>​ [model,​add,'​MyName','​Username','​xtype [ name: week_days, base: symbolic, ordered: yes, domain: [moday,​tuesday],​ desc: \'This is only one definition\'​].'​]. </​code>​ +  - Adding a model in hmr format ​<​code>​ [model,add,hml,'​MyName','​Username','​xtype [ name: week_days, base: symbolic, ordered: yes, domain: [moday,​tuesday],​ desc: \'This is only one definition\'​].'​]. </​code>​ 
-  - Getting a model <​code>​ [model,​get,'​MyName','​Username'​].</​code>​As a result following message should be returned:<​code>​[true,​ [xtype[name:​week_days,​ base:​symbolic,​ ordered:​yes,​ domain:​[moday,​ tuesday], desc:'​This is only one definition'​].]]</​code>​ +  - Getting a whole model in hmr format ​<​code>​ [model,get,hmr, '​MyName','​Username'​, [[all]]].</​code>​As a result following message should be returned:<​code>​[true,​ [xtype[name:​week_days,​ base:​symbolic,​ ordered:​yes,​ domain:​[moday,​ tuesday], desc:'​This is only one definition'​].]]</​code>​ 
-  - Getting a list of all models stored by the server: <​code>​ [model,​getlist].</​code>​ Folling answer can be returned:<​code>​[true,​ [[PHP, hqedmodel0][PHP, temostat], [PHPTermostat2], [PHP, therm-rt], [Username, ​MyName], [XTTd, Termostat1]]]</​code>​+  - Getting all the atrributes and types in hml format <​code>​[model,​get,​hml,​ '​MyName','​Username',​ [[atrs], [tpes]]]</​code>​ 
 +  - Getting a two attribute with IDs ''​att_1'',​ ''​att_2''​ and all the callbacks in the hmr format: <​code>​[model,​get,​hmr,​ '​MyName','​Username',​ [[clbs], [atr, atr_1], [atr, atr_2]]]</​code>​ 
 +  - Getting a list of all models stored by the server: <​code>​ [model,​getlist].</​code>​ Folling answer can be returned:<​code>​[true,​ [[hqedmodel0,​ PHP], [temostatPHP], [Termostat2, ​PHP][therm-rt, PHP], [MyName, Username], [Termostat1, XTTd]]]</​code>​
   - Deleting a model: <​code>​ [model,​remove,​ '​MyName','​Username'​].</​code>​   - Deleting a model: <​code>​ [model,​remove,​ '​MyName','​Username'​].</​code>​
   - Running a model <​code>​ [model,​run,'​temostat','​PHP',​ddi,​ [ms,dt], s1].</​code>​This command will run a Data-Driven inference from state //s1// on the model //​temostat//​ belonging to PHP user. Following return message can be sent by the server:<​code>​[true,​ [[day, 3.0], [hour, 3.0], [month, [2.0]], [season, 3.0], [today, 1.0], [operation, 2.0], [thermostat_settings,​ 16.0]], [ms, 4, dt, 1, th, 3, os, 7]]</​code>​ Instead of state name, clinet can send a full state definition over the protocol:<​code>​ [model,​run,'​MyName','​Username',​ddi,​ [ms,​dt,​th,​os],​ [ [day,​monday],​ [hour,13], [month, january] ] ].</​code> ​   - Running a model <​code>​ [model,​run,'​temostat','​PHP',​ddi,​ [ms,dt], s1].</​code>​This command will run a Data-Driven inference from state //s1// on the model //​temostat//​ belonging to PHP user. Following return message can be sent by the server:<​code>​[true,​ [[day, 3.0], [hour, 3.0], [month, [2.0]], [season, 3.0], [today, 1.0], [operation, 2.0], [thermostat_settings,​ 16.0]], [ms, 4, dt, 1, th, 3, os, 7]]</​code>​ Instead of state name, clinet can send a full state definition over the protocol:<​code>​ [model,​run,'​MyName','​Username',​ddi,​ [ms,​dt,​th,​os],​ [ [day,​monday],​ [hour,13], [month, january] ] ].</​code> ​
hekate/heart_howto.txt · Last modified: 2019/06/27 15:49 (external edit)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0