The number of executed statements for thisapk editorr exceeds 1,000.

Keyboard Shortcuts?
Next menu item
Previous menu item
Previous man page
Next man page
Scroll to bottom
Scroll to top
Goto homepage
Goto search(current page)
Focus search box
Change language:
Brazilian Portuguese
Chinese (Simplified)
PDOStatement::execute
PDOStatement::execute &
Executes a prepared statement
Description
public bool PDOStatement::execute
([ array $input_parameters
or an array of input-only parameter values has to be passed
Parameters
input_parameters
An array of values with as many elements as there are bound
parameters in the SQL statement being executed.
All values are treated as PDO::PARAM_STR.
Multiple values cannot be bound t for example,
it is not allowed to bind two values to a single named parameter in an IN()
Binding more values than speci if more keys exist in
input_parameters than in the SQL specified
in the , then the statement will
fail and an error is emitted.
Return Values
Returns TRUE on success or FALSE on failure.
Example #1 Execute a prepared statement with a bound variable and value
&?php/*&Execute&a&prepared&statement&by&binding&a&variable&and&value&*/$calories&=&150;$colour&=&'gre';$sth&=&$dbh-&prepare('SELECT&name,&colour,&calories&&&&FROM&fruit&&&&WHERE&calories&&&:calories&AND&colour&LIKE&:colour');$sth-&bindParam(':calories',&$calories,&PDO::PARAM_INT);$sth-&bindValue(':colour',&"%{$colour}%");$sth-&execute();?&
Example #2 Execute a prepared statement with an array of insert values (named parameters)
&?php/*&Execute&a&prepared&statement&by&passing&an&array&of&insert&values&*/$calories&=&150;$colour&=&'red';$sth&=&$dbh-&prepare('SELECT&name,&colour,&calories&&&&FROM&fruit&&&&WHERE&calories&&&:calories&AND&colour&=&:colour');$sth-&execute(array(':calories'&=&&$calories,&':colour'&=&&$colour));?&
Example #3 Execute a prepared statement with an array of insert values (placeholders)
&?php/*&Execute&a&prepared&statement&by&passing&an&array&of&insert&values&*/$calories&=&150;$colour&=&'red';$sth&=&$dbh-&prepare('SELECT&name,&colour,&calories&&&&FROM&fruit&&&&WHERE&calories&&&?&AND&colour&=&?');$sth-&execute(array($calories,&$colour));?&
Example #4 Execute a prepared statement with question mark placeholders
&?php/*&Execute&a&prepared&statement&by&binding&PHP&variables&*/$calories&=&150;$colour&=&'red';$sth&=&$dbh-&prepare('SELECT&name,&colour,&calories&&&&FROM&fruit&&&&WHERE&calories&&&?&AND&colour&=&?');$sth-&bindParam(1,&$calories,&PDO::PARAM_INT);$sth-&bindParam(2,&$colour,&PDO::PARAM_STR,&12);$sth-&execute();?&
Example #5 Execute a prepared statement using array for IN clause
&?php/*&Execute&a&prepared&statement&using&an&array&of&values&for&an&IN&clause&*/$params&=&array(1,&21,&63,&171);/*&Create&a&string&for&the&parameter&placeholders&filled&to&the&number&of&params&*/$place_holders&=&implode(',',&array_fill(0,&count($params),&'?'));/*&&&&This&prepares&the&statement&with&enough&unnamed&placeholders&for&every&value&&&&in&our&$params&array.&The&values&of&the&$params&array&are&then&bound&to&the&&&&placeholders&in&the&prepared&statement&when&the&statement&is&executed.&&&&This&is&not&the&same&thing&as&using&PDOStatement::bindParam()&since&this&&&&requires&a&reference&to&the&variable.&PDOStatement::execute()&only&binds&&&&by&value&instead.*/$sth&=&$dbh-&prepare("SELECT&id,&name&FROM&contacts&WHERE&id&IN&($place_holders)");$sth-&execute($params);?&
Some drivers require to
before executing next statement.
- Prepares a statement for execution and returns a statement object
- Binds a parameter to the specified variable name
- Fetches the next row from a result set
- Returns an array containing all of the result set rows
- Returns a single column from the next row of a result set
simplified $placeholder form
$data = ['a'=&'foo','b'=&'bar'];
$keys = array_keys($data);
$fields = '`'.implode('`, `',$keys).'`';
$placeholder = substr(str_repeat('?,',count($keys)),0,-1);
$pdo-&prepare("INSERT INTO `baz`($fields) VALUES($placeholder)")-&execute(array_values($data));
Note that you must
- EITHER pass all values to bind in an array to PDOStatement::execute()
- OR bind every value before with PDOStatement::bindValue(), then call PDOStatement::execute() with *no* parameter (not even "array()"!).
Passing an array (empty or not) to execute() will "erase" and replace any previous bindings (and can lead to, e.g. with MySQL, "SQLSTATE[HY000]: General error: 2031" (CR_PARAMS_NOT_BOUND) if you passed an empty array).
Thus the following function is incorrect in case the prepared statement has been "bound" before:
&?php
function customExecute(PDOStatement &$sth, $params = NULL) {
& & return $sth-&execute($params);
}
?&
and should therefore be replaced by something like:
&?php
function customExecute(PDOStatement &$sth, array $params = array()) {
& & if (empty($params))
& & & & return $sth-&execute();
& & return $sth-&execute($params);
}
?&
Also note that PDOStatement::execute() doesn't require $input_parameters to be an array.
(of course, do not use it as is ^^).
An array of insert values (named parameters) don't need the prefixed colon als key-value to work.&?php$calories = 150;$colour = 'red';$sth = $dbh-&prepare('SELECT name, colour, calories&& FROM fruit&& WHERE calories & :calories AND colour = :colour');$sth-&execute(array('calories' =& $calories, 'colour' =& $colour));?&This allows to use "regular" assembled hash-tables (arrays).That realy does make sense!
Hopefully this saves time for folks: one should use $count = $stmt-&rowCount() after $stmt-&execute() in order to really determine if any an operation such as ' update ' or ' replace ' did succeed i.e. changed some data.Jean-Lou Dupont.
When using a prepared statement to execute multiple inserts (such as in a loop etc), under sqlite the performance is dramatically improved by wrapping the loop in a transaction.
I have an application that routinely inserts 30-50,000 records at a time.& Without the transaction it was taking over 150 seconds, and with it only 3.
This may affect other implementations as well, and I am sure it is something that affects all databases to some extent, but I can only test with PDO sqlite.
&?php
$data = array(
& array('name' =& 'John', 'age' =& '25'),
& array('name' =& 'Wendy', 'age' =& '32')
);
try {
& $pdo = new PDO('sqlite:myfile.sqlite');
}
catch(PDOException $e) {
& die('Unable to open database connection');
}
$insertStatement = $pdo-&prepare('insert into mytable (name, age) values (:name, :age)');
$pdo-&beginTransaction();
foreach($data as &$row) {
& $insertStatement-&execute($row);
}
$pdo-&commit();
[EDITED BY sobak: typofixes by Pere submitted on 12-Sep-]
When passing an array of values to execute when your query contains question marks, note that the array must be keyed numerically from zero. If it is not, run array_values() on it to force the array to be re-keyed.&?php$anarray = array(42 =& "foo", 101 =& "bar");$statement = $dbo-&prepare("SELECT * FROM table WHERE col1 = ? AND col2 = ?");$statement-&execute($anarray);$statement-&execute(array_values($anarray));?&
If one parameter name is missing or misspelled, this function throws an error of level E_WARNING, even when PDO::ATTR_ERRMODE is set to PDO::ERRMODE_SILENT!In the same situation, but when PDO::ERRMODE_WARNING is set, this function throws TWO errors of level E_WARNING!This function does not throw any error when PDO::ERRMODE_EXCEPTION is set, instead, it throws a PDOException.All this applies even when you use PDOStatement::bindParam() function with misspelled parameter name and than use PDOStatement::execute();Tested on: Windows 10, PHP 5.5.35, mysqlnd 5.0.11, MySQL 5.6.30.&?php$dbh-&setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);$colour = 'red';$sth = $dbh-&prepare('SELECT name, colour, calories& & FROM fruit& & WHERE colour = :colour');$sth-&execute(array(':color' =& $colour));?&
If your MySQL table has 500,000+ rows and your script is failing because you have hit PHP's memory limit, set the following attribute.
&?php $this-&pdo-&setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); ?&
This should make the error go away again and return memory usage back to normal.
"You cannot bind more v if more keys exist in input_parameters than in the SQL specified in the PDO::prepare(), then the statement will fail and an error is emitted."& However fewer keys may not cause an error.As long as the number of question marks in the query string variable matches the number of elements in the input_parameters, the query will be attempted.This happens even if there is extraneous information after the end of the query string.& The semicolon indicates the end the rest of the variable is treated as a comment by the SQL engine, but counted as part of the input_parameters by PHP.Have a look at these two query strings.& The only difference is a typo in the second string, where a semicolon accidentally replaces a comma.& This UPDATE query will run, will be applied to all rows, and will silently damage the table.&?php$sql& = "UPDATE my_table SET fname = ?, lname = ? WHERE id = ?";$sql& = "UPDATE my_table SET fname = ?; lname = ? WHERE id = ?"; $pdos = $pdo-&prepare($sql);$pdos-&execute( [ 'foo', 'bar', 3 ] );& & & & & & & & & & & & && ?&PHP 5.4.45, mysqlnd 5.0.10
We know that you can't see the final raw SQL before its parsed by the DB, but if you want to simulate the final result, this may help.&?phppublic function showQuery($query, $params)& & {& & & & $keys = array();& & & & $values = array();& & & & & & & & foreach ($params as $key=&$value)& & & & {& & & & & & if (is_string($key))& & & & & & {& & & & & & & & $keys[] = '/:'.$key.'/';& & & & & & }& & & & & & else& & & & & & {& & & & & & & & $keys[] = '/[?]/';& & & & & & }& & & & & & & & & & & & if(is_numeric($value))& & & & & & {& & & & & & & & $values[] = intval($value);& & & & & & }& & & & & & else& & & & & & {& & & & & & & & $values[] = '"'.$value .'"';& & & & & & }& & & & }& & & & & & & & $query = preg_replace($keys, $values, $query, 1, $count);& & & & return $query;& & }?&
hi,just a qick note to get started without problems when using quotation: PDO does NOT replace given variables if they are wrapped in quotationmarks, e.g.&?php$st = $db-&prepare( '& & INSERT INTO fruits( name, colour )& & VALUES( :name, ":colour" )';$st-&execute( array( ':name' =& 'Apple', ':colour' =& 'red' ) );?&results in in a new fruit like -& Apple, :colourwithout the colour beeing replaced by "red". so leave variables WITHOUT the quotation - PDO will do.
When you try to make a query with a date, then take the whole date and not just a number.This Query will work fine, if you try it like this:SELECT * FROM table WHERE date = 0But if you try it with prepared you have to take the whole date format.&?php$sth = $dbh-&prepare('SELECT * FROM table WHERE date = :date');$sth-&execute( $arArray );$arArray = array(":date",0);$arArray = array(":date"," 00:00:00");?&There must be something with the mysql driver.best regardsT-Rex
Note:& Parameters don't work with a dash in the name like ":asd-asd" you can do a quick str_replace("-","_",$parameter) to fix the issue.
It seems, that the quoting behaviour has changed somehow between versions, as my current project was running fine on one setup, but throwing errors on another (both setups are very similar).Setup 1: Ubuntu 6.10, PHP 5.1.6, MySQL 5.0.24aSetup 2: Ubuntu 7.04, PHP 5.2.1, MySQL 5.0.38The code fragment which caused problems (shortened):&?php$stmt = $pdo-&prepare("SELECT col1, col2, col3 FROM tablename WHERE col4=? LIMIT ?");$stmt-&execute(array('Foo', 1));?&On the first Setup this executes without any problems, on the second setup it generates an Error:SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1The problem is, that $stmt-&execute() quotes the number passed to the second placeholder (resulting in: ... LIMIT '1'), which is not allowed in MySQL (tested on both setups).To prevent this, you have to use bindParam() or bindValue() and specify a data type.
If you are having issues passing boolean values to be bound and are using a Postgres database... but you do not want to use bindParam for *every* *single* *parameter*, try passing the strings 't' or 'f' instead of boolean TRUE or FALSE.
I realized that I ran into serious trouble when debugging my PHP scripts from the command line, and despite of going to fetchAll and so, I always got the error SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.I realized that I had a double init command: PDO::MYSQL_ATTR_INIT_COMMAND =& "SET NAMES utf8; SET CHARACTER SET utf8;"The first one is the better choice and removing the latter, the error is gone.
If you're going to derive PDOStatement to extend the execute() method, you must define the signature with a default NULL argument, not an empty array.In otherwords:&?phpclass MyPDOStatement extends PDOStatement {& function execute($input_parameters = null) {& & & return parent::execute($input_parameters);& }}?&As a sidenote, that's why I always set default parameter to NULL and take care of handling the actual correct default parameters in the body of the method or function. Thus, when you have to call the function with all the parameters, you know to always pass NULL for defaults.
I've used it and it returns booleans=&$passed = $stmt-&execute();if($passed){echo "passed";} else {echo "failed";}If the statement failed it would print failed.& You would want to use errorInfo() to get more info, but it does seem to work for me.
As of 5.2.6 you still can't use this function's $input_parameters to pass a boolean to PostgreSQL. To do that, you'll have to call bindParam() with explicit types for each parameter in the query.
It's been 7 years since simon dot lehmann at gmx dot comment, but today I found myself having problems with a prepared statement involving an INSERT, PDO odbc driver for Microsoft Access and PHP 5.4.7. The prepared statement was done using the prepare + execute method, throwing an ugly"SQLExecDirect[-3500] at ext\\pdo_odbc\\odbc_driver.c:247" errorand a42000 ("Syntax error or access violation") SQLSTATE.He suspects what the problem is and points to a possible solution: using bindParam() or bindValue() and specify a data type.Well, that seems to be right identifying the source of the problem, but there is a simpler solution that worked for me, simpler and that allows you to continue using pdo::prepare() with ? as parameters and pdo::execute():the only thing you have to do is, if not done before, a cast of the binded parameters to its specific type (the type that the database is expecting) before putting them in the array you pass to pdo::execute($array).The following code fails, throwing the error above:&?php$name = "John";$length = "1";$price = "1.78";$SQL = "INSERT INTO table (name, length, price) VALUES (?,?,?)";$arra = array($name, $length, $price);$sth = $msq-&prepare($SQL);$sth-&execute($arra);?&This one works for me like a charm:&?php$name = "John";$length = (int)"1"; $price = (float)"1.78"; $SQL = "INSERT INTO table (name, length, price) VALUES (?,?,?)";$arra = array($name, $length, $price);$sth = $msq-&prepare($SQL);$sth-&execute($arra);?&
Debugging prepared statements can be a pain sometimes when you need to copy a query and run it in the DB directly.& The function below is an example of how to compile your own query (of course it would need some tweaking and may not work in all scenarios).&?php$sql = "& & SELECT t1.*& & FROM table1 AS t1& & INNER JOIN table2 AS t2 ON (& & & & t2.code = t1.code& & & & AND t1.field1 = ?& & & & AND t1.field2 = ?& & & & AND t1.field3 = ?& & )";$stmt = $pdo-&prepare($sql);$params = [ 'A', 'B', 'C' ];$stmt-&execute($params);debug($sql, $params);function debug($statement, array $params = []){& & $statement = preg_replace_callback(& & & & '/[?]/',& & & & function ($k) use ($params) {& & & & & & static $i = 0;& & & & & & return sprintf("'%s'", $params[$i++]);& & & & },& & & & $statement& & );& & echo '&pre&Query Debug:&br&', $statement, '&/pre&';}?&This would output something like:SELECT t1.*FROM table1 AS t1INNER JOIN table2 AS t2 ON (& & t2.part_code = t1.code& & AND t1.field1 = 'A'& & AND t1.field2 = 'B'& & AND t1.field3 = 'C')
If you don't want to turn on exception raising, then try this:& & //$dbErr = $dbHandler-&errorInfo(); OR& & $dbErr = $dbStatement-&errorInfo();& & if ( $dbErr[0] != '00000' ) {& & & & print_r($dbHandler-&errorInfo());& & & & die( "&div class='redbg xlarge'&FAILED:& $msg&/div&&br /&".$foot);& & // or handle the error your way...& & & & & & }& & echo "SUCCESS:& $msg&br /&";... continue if succesful
The example shows this to generate the needed number of question marks, which is amazingly wasteful:$place_holders = implode(',', array_fill(0, count($params), '?'));Instead, just do:$place_holders = '?'.str_repeat(',?', count($params)-1);
You could also use switch the order of t1 and t2 to get user_id from t1 (tested on postgresql):SELECT&& t2.*,&& t1.user_id, t1.user_nameFROM table1 t1LEFT JOIN table2 t2 ON t2.user_id = t1.user_idWHERE t1.user_id = 2
For a query like this:SELECT&& t1.user_id, t1.user_name,&& t2.*FROM table1 t1LEFT JOIN table2 t2 ON t2.user_id = t1.user_idWHERE t1.user_id = 2If I don't have an entry in table2 for user_id=2, the user_id in& result will be empty.SELECT&& t1.user_id, t1.user_name,&& t2.user_pet, t2.user_color, t2.user_signFROM table1 t1LEFT JOIN table2 t2 ON t2.user_id = t1.user_idWHERE t1.user_id = 2This query will return nonempty user_id. So please be careful with wildcard select.
Note the return values for this method. [bool]& =& true or falseSo when i check several queries like INSERT, UPDATE,& REPLACE AND DELETE, i got accurate results =&& bool(true) i.e. The query executed successfully.$query = "SELECT session_data" FROM& sessions WHERE session_id = ?";$stmt = $pdo-&prepare($query);$stmt-&bindValue(1, 'login_user_5121');if($stmt-&execute()) {& & print 'Query executed successfully';}//OutputQuery executed successfullySo, i think u might not have to use { $stmt-&rowCount() } method to know whether the query executed successfully.But on every community i haven't seen anyone point out, so i might be wrong here but u should give it a try with several queries.Access denied | www.alternet.org used Cloudflare to restrict access
Please enable cookies.
What happened?
The owner of this website (www.alternet.org) has banned your access based on your browser's signature (43ee227e7fcc53a2-ua98).Event based system for use within the creation and implementation of educational simulations
United States Patent 7016880
A method and system of creating an education simulation having a character that a learner interacts with is disclosed. The method includes providing a simulation interface through a simulation software code, wherein the character appears within the simulation interface, providing a data storage area for storing a trait of the character, the trait having a trait value, communicating possible statements and/or actions through the simulation interface to the learner, receiving from the learner a chosen statement or action from the possible statements and/or actions, responding to the statement or action chosen by the learner by providing a character response by the character, wherein the character response provided is determined by the trait value of the at least one trait, and generating new possible statements and/or actions for the learner contained within the data storage area.
Inventors:
Adams, David L. (Mesa, AZ, US)
Mitchell, Scott L. (Paradise Valley, AZ, US)
Navabi, Dariush (Phoenix, AZ, US)
O'brien, Jean-paul (Nederland, CO, US)
Sferlazza, Salvatore R. (Nanuet, NY, US)
Youngren, Malcolm P. (Chicago, IL, US)
Zmrhal, Teddy D. (Phoenix, AZ, US)
Application Number:
Publication Date:
03/21/2006
Filing Date:
09/21/2000
Export Citation:
SmartForce PLC (Redwood City, CA, US)
Primary Class:
Other Classes:
International Classes:
G06F17/00; G06F17/20
Field of Search:
704/275, 706/11, 706/14, 706/46
View Patent Images:
&&&&&&PDF help
US Patent References:
6658388Kleindienst et al.704/2756651044Stoneman706/106319010Kikinis434/1696144938Surace et al.704/2576134539O'Connor et al.706/456125358Hubbell et al.706/116101489Lannert et al.706/456085184Bertrand et al.706/456073127Lannert et al.706/456032141O'Connor706/456029159Zorba et al.706/476029158Bertrand et al.706/456029156Lanner et al.706/116026386Lannert et al.706/456023692Nichols706/146023691Bertrand et al.706/26018732Bertrand et al.706/606018731Bertrand et al.706/476018730Nichols et al.706/456016486Nichols706/476003021Zadik et al.706/475987443Nichols et al.706/115739811Rosenberg et al.345/1615722418Bro600/5455676551Knight et al.434/236
Primary Examiner:
Hirl, Joseph P.
Attorney, Agent or Firm:
Bell, Boyd & Lloyd LLC
Parent Case Data:
RELATED APPLICATIONSThis
Application claims the benefit of U.S. Provisional
Application No. 60/155,004, filed on Sep. 21, 1999, which is
hereby incorporated by reference and made a part of the
present specification.
What is claimed is:
1. A computer implemented method of creating an education simulation having a simulated character for a learner to interact with, the method comprising: providing a simulation interface through a simulation software code, wherein the simulated character appears within the
providing a data storage area for storing at least one trait of the simulated character, the at least one trait having a trait value, communicating possible user statements through the simulation inte receiving from the learner a selected user statement from the poss responding to the selected user statement by providing a character response by the simulated character, wherein the character response provided is determined by the trait value of th and, generating new possible statements for the learner contained within the data storage area.
2. The method of claim 1 wherein the data storage area stores a plurality of character traits which together reflect a data value indicative of a state of mind of the simulated character.
3. The method of claim 1 wherein the data storage area stores a plurality of character traits which together reflect a data valve indicative of a personality of the simulated character.
4. The method of claim 1 wherein the at least one character trait is a data valve indicative of a desire to buy a product or a service.
5. The method of claim 1 wherein the data storage area is a dynamic data model.
6. The method of claim 5 wherein the dynamic data model is independent of the simulation software code.
7. The method of claim 1 wherein the trait value of the at least one trait is calculated by adding a previous trait value with a trait change value for the at least one trait.
8. The method of claim 7 wherein the trait change value for the at least one trait is calculated by adding a previous trait change value with a force value.
9. The method of claim 8 wherein the force value is determined by whether the learner has selected a neutral statement or action.
10. The method of claim 8 wherein the force value is determined by whether the learner has identified a problem.
11. The method of claim 8 wherein the force value is determined by whether the learner has identified a solution.
12. The method of claim 8 wherein the force value is determined by whether the learner has identified a solution after the learner has met a problem threshold value.
13. The method of claim 8 wherein the force value is determined by whether the learner has identified a correct answer.
14. The method of claim 8 wherein the force value is determined by whether the learner has identified an incorrect answer.
15. The method of claim 10, 11, 12, 13, or 14 wherein the force value depends on at least one predetermined value that is selectable by a designer.
16. The method of claim 8 wherein the force value is determined by a decay.
17. The method of claim 16 wherein the decay is negative when the learner has positively impacted the trait value.
18. The method of claim 16 wherein the decay is positive when the learner has negatively impacted the trait value.
19. The method of claim 16, 17, or 18 wherein the decay has a rate and direction that are selectable by a designer.
20. The method of claim 1 wherein the trait value has a minimum trait value, a maximum trait value, and a default trait value.
21. The method of claim 20 wherein the trait value has a minimum limit threshold value and a maximum limit threshold value, wherein a first difficulty level associated with the leaner reaching a minimum trait value increases once the trait value reaches the minimum limit threshold, and wherein a second difficulty level associated with the leaner reaching a maximum trait value increases once the trait value reaches the maximum limit threshold.
22. The method of claim 1 wherein the at least one trait has at least one of a rate of change and a direction of change.
23. The method of claim 22 wherein the rate of change has a minimum, a maximum, and a default value.
24. A computerized method of creating a response by a simulated character within an education simulation for a learner, the method comprising the steps of: providing a data storage area for storing at least one trait of the simulated character, the at least one trait having a trait value, receiving from the learner a user statement from possible user statements provided by the simulated character, responding to the selected user statement by providing a character response by the simulated character, wherein the character response provided is determined by the trait value of the at least one trait, and generating new possible statements for the learner contained within the data storage area.
25. A computer system for creating a response by a character within an education simulation for a learner, the computer system comprising: a data storage area for storing at least one trait of the character, the at least one trait having a trait value, a first code segment for receiving from the learner a chosen user statement from a list of poss a second code segment responding to the selected user statement received in the first code segment by providing a character response by the character, wherein the character response provided is determined by the trait value of the at least one trait.
Description:
TECHNICAL FIELDThe present invention relates to the field of educational simulation creation. More specifically, the present invention relates to an event and action based system for simplifying the process of creating an educational simulation.BACKGROUND OF THE INVENTIONTraditionally, all computer software contains two fundamental constructs: data and the functions that manipulate the data. Historically, educational simulations have blended the two together. Most educational simulation use tree structures to define where the student is in the simulation, and within each node of the tree, there has been both data and functions that control the data. The problem is that this is very inefficient because it spreads the programming throughout the data and tree and makes finding “bugs” more difficult. Therefore, in the past, the level of skill required to create an educational simulation has been very high. Educational simulation creation has typically required someone with significant computer programming skills.The present invention solves this problem by separating the data from the functions that manipulate the data. The control functions have been separated into algorithms which are separate from the data of the simulation. By creating a custom control algorithm, the present invention has also enforced quality because all simulation designers have to create simulations that conform to the algorithm. Another benefit to this model is increased speed of operation due to the streamlining of each algorithm for its specific purpose.Another way to create educational simulations would be to use a rule-based expert system or other traditional Artificial Intelligence technologies. In a rule-based expert system there are rules, facts and an inference engine. First, the system asserts facts, then the rules run and “inferences” are made. An example is:
Assert Fact→MopsyDog has #ofMopsyLegs, TypeofMopsyFurAssert Fact→#ofMopsyLegs=3Assert Fact→#ofMopsyLegsGrowing=0Assert Fact→TypeofMopsyFur=BrownRun Rule→#of MopsyLegs=#ofMopsyLegs+#ofMopsyLegsGrowingRun Rule→if (?Variable? has (Legs=4) and (Fur=Brown)) then (Assert Fact →?Variable?=Dog)
Run Inference Engine
Fact→MopsyDog has (#ofMopsyLegs=3), (TypeofMopsyFur=Brown)Assert Fact→#of MopsyLegsGrowing=1
Run Inference Engine
Fact→MopsyDog has (#of MopsyLegs=4), (TypeofMopsyFur=Brown)
Fact→MopsyDog is Dog
A Rule-Based Expert System is used to define new facts such as “MopsyDog is Dog.” It could be used to control an educational simulation. There are two big drawbacks to using an inference engine to control an educational simulation. First, AI technologies and rule-based expert systems use too much of a computer's random access memory. The amount of analysis required for the inference engine is great. Second, the artificial intelligence technologies allow for main control structures to mix data and functions. By allowing the mixture of functions and data, the amount of debugging and expertise in programming each simulation is greater than the present invention.SUMMARY OF THE INVENTIONThe present invention provides a method of creating an education simulation having a character for a learner to interact with. The method comprising the steps of providing a simulation interface through a simulation software code, wherein the character appears within the simulation interface, providing a data storage area for storing at least one trait of the character, the at least one trait having a trait value, communicating possible statements and/or actions through the simulation interface to the learner, receiving from the learner a chosen statement or action from the possible statements and/or actions, responding to the statement or action chosen by the learner by providing a character response by the character, wherein the character response provided is determined by the trait value of the at least one trait, and generating new possible statements and/or actions for the learner contained within the data storage area. Also provided is a system for performing the method.In another aspect the present invention provides a method of creating a data structure for a character trait of a character for a conversation based educational simulation for a learner. The method comprises the steps of providing character trait data structure editing software, creating a data structure comprising a set of initial values for the character trait, a set of personalization variables for the character which cause the character to respond in a particular manner to selections of the learner, and set of effect values for use within the calculation of a trait value for the character trait in response to the selections of the learner. Also provided is a system for performing the method.Other features and advantages of the invention will be apparent from the following detailed description taken in conjunction with the drawings.BRIEF DESCRIPTION OF THE DRAWINGSFIG. 1 is a diagram of the system of the present invention according to a FIG. 2 is a diagram of a conversation tree structure of the present invention according to a FIG. 3 is a diagram of the system of the present invention according to a FIGS. 4a–e is a flow chart of the system of the present invention according to a FIG. 5 is a world data model state diagram of the system of the present invention according to a FIG. 6 is a screen shot of the a development tool of the system of the present invention according to a FIG. 7 is a screen shot of the a development tool of the system of the present invention according to a FIG. 8 is a screen shot of the a development tool of the system of the present invention according to a
andFIG. 9 is a a screen shot of the a development tool of the system of the present invention according to a preferred embodiment.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTWhile this invention is susceptible of embodiments in many different forms, there will herein be described in detail preferred embodiments of the invention with the understanding that the present disclosure is to be considered as exemplifications of the principles of the invention and is not intended to limit the broad aspects of the invention to the embodiments illustrated.The present invention relates to a novel training software, system and method for teaching users how to perform a task. Users of the system learn the task by operating a computer which simulates a real world experience in which the task is performed. Users have options to use simulated tools to perform the task and interact with simulated people or characters in order in performing the task. Additionally, the user of the system is evaluated in the choices that a person makes to perform the task. The evaluation can be performed in a variety of ways, such as assigning an overall score to the person's performance in the simulation or assigning a running average to the person's performance to determine whether the person has improved or has learned by performing the simulation, and no single way is the correct way, but should be tailored to the type of simulation executed. By using the simulation, learners can learn to perform a task in an environment where the learner's mistakes are not costly to their employer but still gain the experience of “learning by doing.”Referring to FIG. 1, there is shown a client computer 2 accessible by a learner 4. The client computer 2 is any computer capable of running software which is can access and view content over a computer network, preferably a wide area network such as the Internet 6. Most often, the client computer 2 is a personal computer running a Microsoft Windows or Mac OS operating system and an HTML browser, such as Microsoft Internet Explorer or Netscape Navigator. However, the client computer 2 can take any form, including a handheld device. Other software may also exist on the client computer 2 in order to access multimedia aspects of the learning process, such as streaming audio and video. Also connected to the Internet 6 is a simulation server 8 and, optionally, a media server 10. The simulation server 8 comprises known HTTP server software, such as Microsoft Internet Information Server running on a Windows NT operating system, as well as software for creating the simulation. The simulation server 8 is responsive to requests from the client computer 2 to view learning content via the Internet 6. The simulation server 8 communicates with a database server 12 in order to provide the learning content. The simulation server 8 is also capable of communicating with multiple client computers 2, 2′, 2″ for different learners 4, 4′, 4″. It should be understood that the physical arrangement of FIG. 1 is representative, and the present invention can be implemented in numerous physical arrangements without departing from the scope of the present invention.The objects, people and state of the simulation within any particular simulation comprises “the world” for the purposes of a simulation. The present state of the world at any particular moment within the simulation is represented by a world data structure. The world data structure contains variables which represent each aspect of the world at any point in time. Preferably, the world data structure is stored as an XML data structure which comprises variables containing information about the state of the world. In memory, the world comprises an object model. The types of data that is contained in the world are people, places, triggers, objectives and props. Each of these data types may have subtypes associated with them. For example, subtypes of props which exist in the world can be meetings having statements and outputs associated therewith, a desktop, a browser, having favorites, an email having an inbox, sent box, drafts box, and bin with email messages associated therewith. All of these data types are associated with properties and events which describe the item and give the item its states and properties for interaction with the world, as described below.Referring to FIG. 3, the simulation server 8 executes software for creating the simulation and communicating the state of the simulation to the client computers 2, 2′, 2″. The simulation server 8 comprises components for maintaining the appearance of a dynamic user interface generation module 19, a cycle director 25, a conversation algorithm 26, a character algorithm 28, an evaluation algorithm 30, the world data structure 20, and a simulation CORE 32. The simulation server 8 communicates with the database server 12 to retrieve simulation user interface data from the content/metadata storage 34 and the media storage 36.Significantly, the simulation server 8 i only the world data structure 20 contains information about the state of the simulation. By providing that the simulation server 8, and in particular the code or software running thereon is independent of the state of the simulation, the present system can be used and reused to implement new simulations without reprogramming of the system itself New simulations can be created by associating new peoples, places, triggers, objectives and props with the simulation. Therefore, the simulation server 8 acts as a static architecture around which simulations may be created. In this manner, the creation of a simulation and conversations therein becomes easier to perform. Software developers are no longer required in order to create even the most complex simulations and conversations.The dynamic user interface generation module 19 further comprises a java servlet 22, a prop producer 24, and a prop 26. The java servlet 22 receives requests from the client computers 2, 2′, 2″ and transmits HTML and multimedia data which comprise the user interface of the simulation to the client computers 2, 2′, 2″ in response to the requests. The java servlet 22 also updates the prop producer 24 in response to actions taken by the learner. The client computer sends a request which takes the form http://servername.com/FirstPerson?Prop=Email&Enabled=true, where “http://” indicates the request is an http request, “servername.com” identifies the simulation server 8, “FirstPerson” identifies the java servlet 22 to be accessed, “?” indicates the beginning of values to be passed to the java servlet 22, “Prop=Email” is a variable and variable value to be passed, “&” indicates the beginning of a new variable and value to be passed, and “Enabled=true” indicates a new variable and value to be passed to the applet.The prop producer 24 next communicates with the prop 26. The prop 26 then updates the state of the world data structure 20 by manipulating the structure 20 to represent the action taken by the learner 4. For example, if the learner in a simulation decided to open an email, the world data structure would be altered to indicate the email is now open.The simulation server 8 also communicates with the cycle director 25. The cycle director 25 controls the process for determining how the simulation is going to react to an action taken by the learner 4. The cycle director 25 first executes the conversation algorithm 26. The combination of the conversation algorithm 26 and the world data structure determine both how to respond to the statement made by the learner 4 and creates a list of statements which the learner can choose from in order to respond to the simulation.Conceptually, the present invention uses a tree structure in order to allow the learner to navigate within a simulation. Referring to FIG. 2, the tree structure 200 comprises multiple tasks 202, 204. An example of a task is introducing the members of a person's family. Groups of tasks comprise conversations, and tasks are subsections of conversation. An example of a conversation is talking about a person's family. Tasks are be associated with each other in levels, with subtasks of a task called child tasks and higher level tasks called ancestor tasks. Tasks on the same level are sibling tasks. Associated with each task are statements which can be made. Statements may invoke subtasks or transition to sibling tasks. Exploratory conversations have transition statements which allow a learner to move between the tasks. Procedural conversations have a required a required sequence, therefore, do not have transition statements. Statements which are associated with a current task are called candidate statements. Tasks may also be specific or directional. Statements presented to the user for selection when the current task is a specific task are the statements associated with the current task and the current task's sibling tasks. Statements presented to the user for selection when the current task is a directional task are the statements associated w therefore, the only way to move on to an ancestor task when performing a directional task is to complete the task. Finally, tasks may also be described as leaf tasks or non-leaf tasks. Leaf tasks are tasks which have no child tasks. While procedural and exploratory conversations and directional and specific tasks are described, it is to be understood that other types of conversations, tasks and statements can be implemented without departing from the scope of the present invention.Clicking on a statement invokes a task. Associated with the task is a required proof and a proof contribution value. In order for a task to be complete, its required proof value must equal or be exceeded by the proof contribution provided by its child tasks. For example, consider a task with a proof contribution of 50 and three child tasks, and the first, second and third child tasks have proof contributions of 50, 20 and -10, respectively. If the first child task is chosen by the learner, the proof contribution (50) of the parent task is satisfied by the first task's proof contribution (50) and the second and third tasks are not required to be completed. However, if the third child task (with a proof contribution of -10) is chosen, the required proof of the parent task can only be met be the learner performing all three child tasks (50+20-10=60).The conversation algorithm 26 implements the rules of conversation, sets triggers and fires events in order to maintain the simulation and provide the learner with logical options for response to the simulation. FIGS. 4a through 4e show how the conversation tree is maneuvered by the conversation algorithm 26. The conversation algorithm 26 is event driven. When an event is fired, the routines associated with the event are executed. The routines change the properties of the world in response the statements the learner has chosen to make. Specifically referring to FIGS. 4a and 4b, in step 400, the conversation algorithm 26 first clears any previous responses made by the learner 4. Next, the conversation algorithm 26 determines whether the selected conversation is currently running in step 402. If the conversation is not currently running, the algorithm 26 proceeds to step 404 where the algorithm 26 determines whether the isRejected property equals true for the conversation. An example of a rejected conversation would be an attempt to begin a conversation which assumes something that requires the learner to first complete, such as reading an email or completing a different conversation first.If isRejected=true then the algorithm 26 fires the onRejected event in step 406. If isRejected=false the algorithm 26 next determines whether the selected conversation has previously been started in step 410. If the conversation has previously been started the algorithm 26 skips to step 416. If the conversation has not previously been started, the algorithm 26 starts the conversation in step 412 and fires the onConversationBegin event in step 414. In step 416 the algorithm 26 fires the OnConversationEnter event and proceeds to step 418.If, in step 402 the selected conversation is currently started, the algorithm proceeds to step 418. In step 418, the algorithm 26 fires the onConversationRun event. Next in step 420, the algorithm 26 determines whether the isRejected=true for the statement selected by the learner 4. If the statement is rejected, the algorithm 26 fires the onRejected event in step 422.If, in step 420, isRejected≠true then the algorithm 26 next determines whether the sequence of the statement selected is out of order in step 426. If the sequence of the statement selected is out of order, the algorithm 26 fires the OutofSequence event in step 428. If the sequence of the statement selected is not out of order, the algorithm 26 sets the selected task to active in step 428, increments the task occurrence count for the selected task in step 430, and fires the onResponse event in step 432. The algorithm then proceeds to step 442.In step 442, the algorithm 26 determines whether the conversation is procedural or exploratory. Referring to FIG. 4c, if the conversation is procedural the conversation algorithm 26 next determines whether the task is directional or specific in step 444. In step 446, the algorithm 26 determines whether the current task is a leaf task. If the current task is a leaf task the algorithm advances to step 436 where the algorithm 26 sets the current task to complete and proceeds to step 448. In step 448, the algorithm 26 sets the nearest incomplete ancestor task 448 as the current task and advances to step 452.If, in step 446, the current task is not a leaf task the algorithm 26 advances to step 450. In step 450, the algorithm 26 determines whether the current task is complete. If the current task is complete, the algorithm advances to step 436 where the algorithm sets the current task to complete and advances to step 448. Otherwise, the algorithm 26 advances to step 452. In step 452, the algorithm creates a statement list from which a learner may choose a next statement which comprises candidate statements of the current task.If, in step 444, the conversation is specific, the algorithm 26 advances to step 454. In step 454, the algorithm 26 determines whether the current task is a leaf task. If the current task is a leaf task the algorithm advances to steps 436, 438 and 448 where the algorithm sets the current task to complete, fires the onTaskComplete event, and sets the current task equal to the nearest incomplete ancestor task, respectively. The algorithm next advances to step 456. In step 456, the algorithm 26 determines whether the task is a required task. If the task is required, in step 458, the algorithm 26 creates a statement list from candidate statements of the current task and adds invoking statements of uninvoked sibling tasks of the current task in step 460.If the current task is not required in step 456, the algorithm 26 proceeds to step 462, where the current task is set equal to the nearest incomplete ancestor task and advancers to step 464. In step 464, the statement list is created from statements of the nearest required ancestor of the current task.In step 454, if the current task is not a leaf task the algorithm advances to step 466, where the algorithm determines whether the current task is complete. If the current task is complete, the algorithm advances to step 438, where the algorithm 26 fires the OnTaskComplete event. The algorithm next proceeds to step 468 where the current task is set equal to the nearest incomplete ancestor task and further proceeds to step 470. If, in step 466, the current task is not complete, the algorithm 26 advances to step 470 where the statement list is created from candidate statements of the current task. From step 470, the algorithm advances to step 472 where invoking statements of uninvoked siblings of the current task are added to the statement list.Referring back to FIG. 4b, if in step 442 the conversation is exploratory the algorithm proceeds to step 474 (FIG. 4d). In step 474, the algorithm inquires as to whether the task is directional or specific. If the conversation is directional the algorithm 26 proceeds to step 476. At step 476, the algorithm 26 determines whether the current task is a leaf task the algorithm 26 proceeds to step 436 and 438, if the current task is a leaf task the algorithm 26 sets the current task to complete in step 436, fires the OnTaskComplete event in step 438 and sets the current task equal to the nearest incomplete ancestor task at step 478 and creates the statement list from transition and candidate statements of the nearest required ancestor of the current task at step 480.If the current task, at step 476, is not a leaf task, the algorithm 26 proceeds to step 482 (FIG. 4e). At step 482, the algorithm 26 determines whether the current task is complete. If the current task is complete, the algorithm 26 fires the OnTaskComplete event at step 438 and advances to step 484. At step 484, the algorithm 26 sets the current task equal to the nearest incomplete ancestor and proceeds to step 486. If at step 476 the current task is not complete, the algorithm 26 proceeds to step 486. At step 486, the algorithm creates the statement list from candidate statements of the current task.Returning to FIG. 4d, if, at step 474, the task is specific, the algorithm proceeds to step 488. At step 488, the algorithm 26 determines whether the current task is a leaf task. If the current task is a leaf task, the algorithm 26 sets the current task to complete, fires the OnTaskComplete event and sets the current task equal to the nearest incomplete ancestor task in step 436, 438 and 478, respectively. The algorithm 26 then proceeds to step 490 where the algorithm determines whether the current task is a required task. If the current task is a required task, the algorithm 26 sets the current task equal to the nearest incomplete ancestor at step 492. The algorithm then creates the statement list from transition and candidate statements of the current task, adds invoking statements of the uninvoked siblings of the current task and adds the transition statements of the active siblings of the current task at steps 494, 496 and 498, respectively. Required statements are necessary because many options may exist in the tree structure for conversing about an irrelevant topic. By making irrelevant topics “unrequired topics,” conversations can return to the point in the tree structure where the irrelevant conversation began, the last required task, without having to continue an irrelevant conversation. For example, a conversation with two large branches, one of which is completely irrelevant. If a learner starts down the irrelevant branch, he can go on for a couple of levels of the task and then at the root of the task, a character with whom the learner is talking says, “Let's get back on track here.” In this scenario, the algorithm can return all the way back up the tree to the last required task, i.e. at the point where the irrelevant conversation began.If at step 490 the current task is not a required task, the algorithm proceeds to step 500. At step 500, the algorithm sets the current task equal to the nearest incomplete ancestor task. The algorithm then proceeds to step 502, where the statement list is created from transition and candidate statements of the nearest required ancestor of the current task.If at step 488 the current ask is not a leaf task, the algorithm 26 determines whether the current task is complete at step 504. If the current task is complete, the algorithm advances to step 438 where the algorithm fires the onTaskComplete event at step 438 and proceeds to step 506, where the current task is set equal to the nearest incomplete ancestor of the current task. The algorithm then proceeds to step 508. If at step 504 the current task is not complete, the algorithm proceeds to step 508, where the statement list is created from candidate statements of the current task. The algorithm 26 then adds invoking statements of uninvoked sibling tasks of the current task and adds transition statements of the active siblings of the current task at steps 510 and 512. The previous algorithm is given by way of example and the conversation algorithm is not limited to the present embodiment.As described above the present invention uses an action and event model in order to execute a simulation. At the highest level, the system contains events, actions and properties. During the execution of the conversation algorithm, the character algorithm or the evaluation algorithm, events are fired in order to control the simulation in response to the happening of the event. Below is an example of actions which can be implemented for a simulation. It will be understood by one of ordinary skill in the art the number of possible actions is limitless and the table below is merely a representative example.Conversion Engine Action TableCOMPONENTACTIONPARAMETERSDESCRIPTIONCaseActivateConversation NameActivates a conversationConversationEnd Case—Ends the case. This action triggers anon Case End event, which is normallyused to bring up the case reflection.WorldMove DocumentProp, document, folderMoves a document to a prep folder.Example of usage: to move a documentin the briefcase.Move MessageMessage Name, FolderMoves a message to a folder. Exampleof usage: to a message in the emailmailbox.Activate PersonPersonActivates a person.Add toSection: {High Lights,Adds text to one of the three sections ofReflectionGood Points, Areas ofcase reflection.improvements}, Text:{text}Activate PlacePlace, {true, false}Sets active state of a place to “true” or“false”. Example of usage: to bring upthe meeting background image.Contribute toObjective, integerAdds an integer value to the currentObjectivesproof of an objective. Objectives arenormally used to control order ofconversations within a case.Deactivate—Stops phone rings.Phone RingerActivate Phone—Makes the phone ring.RingerSet Prop ActiveProp, {true, false}Sets the active state of a Prop to “true”Stateor “false”. Example: Setting activestate of Reflection Prop brings up thereflection in the simulation.Set TriggerTrigger, {true, false}Sets the active state of a Trigger toState“true” or “false”.DynamicsUpdate DynamicPerson Model: {desire ToUpdates specified Model of a personModelBuy, . . .}, Input: {correct,based on the Input parameter.Incorrect, . . .}ConversationComplete—Completes the current conversation.ConversationUser cannot come back to a completedconversation.End—Temporarily stops the currentConversationconversation. User can come back tothe conversation.TaskOccurrence: {integer},Action specifies:OccurrenceResponse Text: {text},1) Text to be displayedMedia: {audio file},2) Audio to be playedAction: {any action or3)Action to be performed when theconditional}number of times that task has becomecurrent equals the Occurrenceparameter.
Additionally, exemplary events of the present invention are shown below:COMPONENTACTIONPARAMETERSDESCRIPTIONCaseOn Case BeginSet Prop Desktop activeBring up the meeting background image.state to true ActivateMake the phone ring. Set thePhone Ringer Activateconversation in ready background.Conversation xxxOn Case EndSet Prop Reflection activeBrings up reflection.state to trueConversationIs VisibleObjective xxx isConversation appears in meetingcomplete, trueselection list.OnSet First Time Entry toSet a value in the world props. BringsConversationfalse World: xxxx →up the meeting background image.Beginvalue = 0Set Place xxx active stateto trueOnContribute n to objectiveObjection completion is linked toConversationxxxconversation visibility.EndOnSet Person active state toPerson with dynamic model must be setConversationtrueto active.EnterSet Place active state toBrings up the meeting backgroundtrueimage.Response (occurrence,Send response based on occurrence.statement)OnSet Person xxxx activeDeactivate person with dynamic model.Conversationstate to falseLeaveOnIf (Get Dynamic OutputRules for kick-outs and case completion.Conversation1671/Desire toRunBuy/Desire &1)THEN {Endcase,response (occurrence,statement)}If (Get Dynamic Output1671/Desire toBuy/Desire & 1)THEN {EndConversation)TaskIs HiddenObjective xxxx == falseTo hide part of the conversation tree atrun Time.Is RejectedOn CompletedRoot Task: CompleteCompletes the conversation. SendConversation. Responseresponse.(statement)on Out ofResponse (occurrence,Sequencestatement) UpdateDynamic Model Desire toBuy/learner Incorrect.on Rejectedon ResponseUpdate Dynamic ModelDesire To Buy/ProblemSet Trigger xxxx to trueResponse (occurrence,statement)on TransitionResponse (occurrence,statement)
The character algorithm 28 controls the status of each character within the simulation. In order to accurately model the “state of mind” of each character and provide character responses which accurately reflect that actor's state of mind each character has a character trait model which represents that character's personality. The character trait model specifies a specific behavior or attitude of the actor. As the learner progresses through the simulation, the actor's behavior or attitude will change with the different learner actions. The purpose of the modeled behavior or attitude is to give the actor a more realistic and natural interaction with the learner.Depending on the purpose or goal of the simulation, it is necessary to track aspects of the state of mind of a character or characters in order to determine whether the learner has succeeded or failed in his objective. For example if the learner is attempting to learn how to sell a product to a potential customer, it would be desirable to track a character's desire to buy a product from the learner. Therefore, one aspect to the character's traits, or state of mind, is the “desire to buy” or DTB. The DTB at any point in time has a value, a rate of change, and a direction of change and can be tracked according to the following formula:
DTB=DTBo+C
where DTBo is the previous DTB and C is the change in the DTB. C will be negative or positive depending on whether recent action taken by the learner is a “good” which increases the desire to buy or a “bad” which decreases the desire to buy.
When calculating the next DTB value, the character algorithm 28 retrieves the current value of the given trait (e.g. DTB=65%). It also retrieves from the world data structure the direction and rate at which that trait's value is changing. A DTB equal to 65% tells us that the customer is more interested to buy than not to buy. When the rate and direction of change for that trait is added, another level of personality is added. By using the rate and direction information to track a character's DTB, it can be determined whether the learner is gaining ground with the customer or losing ground with the customer.As mentioned early, during the simulation the learner can affect the character traits of a character with each action the learner takes. Each action creates a force on the DTB. These forces affect the rate of change of the trait and thus the current value of the trait. The value C above is calculated according to the formula
Where Co is the previous value of C and F is the sum effect of the learner action onto the actor's character trait. Any action of the learner can apply a force onto the customer's DTB.
For the DTB trait, there are six potential forces a learner's action can have on the actor's character trait. The forces for the DTB trait come from conversations with and without the actor. The first four forces are possible when the learner is interacting directly with the actor: Problem, Solution, Correct, or Incorrect. When the leaner is in a conversation but not with the actor, the two possible forces on the DTB trait are: Positive Decay or Negative Decay.When the learner is in a conversation with a customer, the statements the learner's possible statements or “selects” are categorized as either neutral, problem, solution, correct, or incorrect. A neutral statement has no affect on the DTB. A correct statement has a positive effect on the DTB. An incorrect statement has a negative affect on the DTB. The amount of force for each statement varies and depends on the design of both the statement itself and the specific instance of the character trait model for the character.Problem statements are also a positive force on DTB. Problem statements are statements where the learner identifies a problem that the customer has. Solution statements may be a positive force at a certain point in a conversation and negative force until that point in the conversation is reached. This is because a customer will not understand or appreciate a solution that the learner is selling until the customer understands and recognizes the problem that the solution is solving. Therefore, problem statements have a Problem Threshold. The Problem Threshold signifies the minimum number of problem statements that the learner must select before a solution statement has a positive affect on the customer's DTB. If the learner selects a solution statement before the problem threshold is met, the statement will have a negative affect on the DTB, even if it is the correct solution.When the learner is not interacting with the character, that character is considered to be idle. During this time, positive or negative decay acts to bring the DTB back to its default start value. For example, if the learner tells the customer that the learner has a product that will solve all of their current problems, the customer may have a very high DTB, which indicates that customer will buy now. However, if the learner does not close the deal, negative decay will lower the DTB over time. Likewise, if the learner has negatively impacted the DTB, over time positive decay will act to increase the customer's DTB as if the customer where “forgetting” the negative impact.For every character trait, such as DTB, there is a minimum, maximum, and default value for the trait value, the rate of change, and the force. These minimum, maximum, and default values may be set by the simulation designer when creating the specific character trait for a given actor. Typical values for minimum, maximum and default are 0, 100 and 50, respectively.When an actor has a trait that is reaching its specified minimum or maximum, it becomes increasingly harder to get the trait to that limit. A limit threshold value specifies at what point it becomes harder to continue in the current direction. For example, if the learner is progressing through the simulation on an expert path, the actor's DTB will be increasing with almost every move. Without a limit threshold, the learner's actions would push the actor's DTB off the charts and above the maximum DTB. Or, the behavior of the actor would appear to the learner as unnatural. By placing a dampening affect to the forces applied to the character trait, the actor reaches the maximum value with a more natural approach.When the actor reaches its limit threshold for the maximum value for DTB, the following formula for calculating C is substituted for the formula for C above:
C=(Co+F)*(DTBmax-DTBO)/(DTBhl)
where DTBmax is the simulation designer specified maximum DTB value and DTBhl is the designer specified DTB high limit point at which to start using the equation.
A similar equation is substituted when the actor's DTB reaches a minimum threshold value:
C=(Co+F)*(DTBo-DTBmin)/(DTBll)
where DTBmin is the designer specified minimum DTB value and DTBll is the designer specified DTB low limit point at which to start using the equation.
Optionally, the simulation designer can choose to have a competitor within the simulation compete with the learner to obtain a higher competitor DTB than learner DTB for the customer. The values for the customer's competitor DTB can be either dependent or independent of the learner's actions. Additionally, it is contemplated that an increase in the competitor's DTB could have a negative effect on the learner's DTB, or vice versa.The evaluation algorithm 30 is a back door to the formalization of the conversation algorithm 26 and the character algorithm 28. With the evaluation algorithm 30, a designer can look at any property in the world and then fire any action based on the evaluation of that property against a variable.In addition, the evaluation algorithm allows incorporation of third party tools, functions, components or objects. If one wanted to include a neural net, rule based-expert system or any other type external impact, that function can be incorporated into the action side of the evaluation algorithm.The evaluation algorithm is best described by the following example:To create a simulation that teaches stockbrokers how to talk with clients about the stock market, a rule-based expert system model of the stock market is included in the simulation via an action in the evaluation algorithm. The user clicks on a statement that the stockbroker should say. That statement is passed to the character engine, which determines which statements to show and which response to display. That same statement is then passed to the character engine, and the character engine va

我要回帖

更多关于 wangeditor 的文章

 

随机推荐