how to input value in pattern entry - optaplanner

I'm studying OptaPlanner and I'm needing help at one
point.
I need to why is this pattern used for and how to use:
<Patterns>
<Pattern ID="0" weight="1">
<PatternEntries>
<PatternEntry index="0">
<ShiftType>L</ShiftType>
<Day>Any</Day>
</PatternEntry>
<PatternEntry index="1">
<ShiftType>D</ShiftType>
<Day>Any</Day>
</PatternEntry>
</PatternEntries>
</Pattern>
<Pattern ID="1" weight="1">
<PatternEntries>
<PatternEntry index="0">
<ShiftType>D</ShiftType>
<Day>Any</Day>
</PatternEntry>
<PatternEntry index="1">
<ShiftType>E</ShiftType>
<Day>Any</Day>
</PatternEntry>
<PatternEntry index="2">
<ShiftType>D</ShiftType>
<Day>Any</Day>
</PatternEntry>
</PatternEntries>
I thank you immensely for any kind of help you can give me.

That input file is definied by the INRC2011 website, see link in optaplanner user guide chapter 3.
Specifically:
The first pattern is a Late (L) followed by a Day (D) shift.
The second pattern is a Day shift, then an Early shift and then a Day shift again.
When a pattern matches, there's a penalty involved that lowers the score. The goal is to improve nurse's health by avoiding unhealthy shift patterns.

Related

How to generate position, speed and acceleration of each car in an output file sumo

I'm working on sumo and I want to generate the trajectory for each car in an output file. To generate an output file containing each vehicle's position, speed, acceleration, I found maybe the most suitable output is the following link:
https://sumo.dlr.de/docs/Simulation/Output/AmitranOutput.html
However after generating this output file, I see that it doesn't contain the position information for each car. I appreciate if any one can help me how can I produce these data in an output file in sumo.
Here is what it produces:
<trajectories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/amitran/trajectories.xsd" timeStepSize="1000">
<actorConfig id="6" vehicleClass="Passenger" fuel="Gasoline" emissionClass="Euro4" ref="car"/>
<vehicle id="0" actorConfig="6" startTime="0" ref="myflow.0"/>
<motionState vehicle="0" speed="1425" time="0" acceleration="0"/>
<actorConfig id="7" vehicleClass="Passenger" fuel="Gasoline" emissionClass="Euro4" ref="malicious-car"/>
<vehicle id="1" actorConfig="7" startTime="0" ref="myflowmalicious.0"/>
<motionState vehicle="1" speed="1490" time="0" acceleration="0"/>
<motionState vehicle="0" speed="1557" time="1000" acceleration="1317"/>
<vehicle id="2" actorConfig="6" startTime="1000" ref="myflow1.0"/>
<motionState vehicle="2" speed="932" time="1000" acceleration="0"/>
<motionState vehicle="1" speed="1737" time="1000" acceleration="2465"/>
<motionState vehicle="0" speed="1738" time="2000" acceleration="1809"/>
<motionState vehicle="2" speed="1212" time="2000" acceleration="2799"/>
...
You should use --fcd-output fcd.xml --fcd-output.acceleration.

SCORM 2004 Rollup with single sco

I'm having issues rolling up a completion from a completed item.
I'm running this on SABA and I can successfully set the completion_status and success_status on the item but having issues rolling it up to the next level on the LMS, both satisfied and notSatisfied.
I find these rules utterly confusing. I do mostly work in SCORM 1.2.
This is my chunk to-date. Any assistance is really, really appreciated.
<organizations default="ORG-487461">
<organization identifier="ORG-487461">
<title>STATUS TESTING - 1d</title>
<item identifier="ACT-687940" identifierref="RES-123054">
<title>Launch</title>
<imsss:sequencing>
<imsss:deliveryControls completionSetByContent="true" objectiveSetByContent="true" />
</imsss:sequencing>
</item>
<imsss:sequencing>
<imsss:controlMode choice="true" flow="true"/>
<imsss:rollupRules>
<imsss:rollupRule childActivitySet="any">
<imsss:rollupConditions>
<imsss:rollupCondition condition="satisfied"/>
</imsss:rollupConditions>
<imsss:rollupAction action="satisfied"/>
</imsss:rollupRule>
<imsss:rollupRule childActivitySet="all">
<imsss:rollupConditions conditionCombination="any">
<imsss:rollupCondition operator="not" condition="satisfied" />
</imsss:rollupConditions>
<imsss:rollupAction action="notSatisfied" />
</imsss:rollupRule>
</imsss:rollupRules>
<imsss:rollupRules rollupObjectiveSatisfied="true" rollupProgressCompletion="true" />
</imsss:sequencing>
</organization>
</organizations>
I was deep in this a few years back but I'll try to assist based on some of my prior examples.
I think you need to set a primary objective. Else - I don't believe there is anything to roll up to. I don't however know that for a fact, as it would require going back and doing a deeper dive in to the SCORM 2004 3rd/4th edition spec and covering the IMSS Sequencing section.
Small example for an activity:
<!-- Activity 1 -->
<title>ims_sequencing_objectives</title>
<item identifier="ACT-001" identifierref="RES-001">
<title>SCOBot-QUnit1</title>
<imsss:sequencing IDRef="COMMON_SEQ_RULES">
<imsss:sequencingRules>
<!-- If you also wanted to limit the number of attempts -->
<imsss:preConditionRule>
<imsss:ruleConditions>
<imsss:ruleCondition condition="attemptLimitExceeded" />
</imsss:ruleConditions>
<!-- Can not choose -->
<imsss:ruleAction action="disabled" />
</imsss:preConditionRule>
</imsss:sequencingRules>
<imsss:limitConditions attemptLimit="1" /> <!-- attemptAbsoluteDurationLimit="" set if max_time_allowed -->
<imsss:rollupRules objectiveMeasureWeight="0" />
<imsss:objectives>
<!-- My Understanding is SCO1_SATISFIED will assume the scoring of the SCO, then you can continue to SCO 2 after the preCondition is met. This SCO is just a "intro" no score reported. Removed satisfiedByMeasure -->
<imsss:primaryObjective objectiveID="SCO1_SATISFIED">
<imsss:mapInfo targetObjectiveID="com.cybercussion.SCOBot.ACT-001" readSatisfiedStatus="true" writeSatisfiedStatus="true" readNormalizedMeasure="true" writeNormalizedMeasure="true" />
</imsss:primaryObjective>
</imsss:objectives>
</imsss:sequencing>
Then a subsequent activity would allow the LMS Player the opportunity to decide whether it should allow the navigation/show it using pre/post rules. And I would agree this gets confusing. Further more its even harder to unit test unless you have some rules engine that can parse this realtime to validate your intent. This below sample would be like Activity/SCO 3...
<imsss:preConditionRule>
<imsss:ruleConditions>
<imsss:ruleCondition referencedObjective="SCO2_SATISFIED" condition="satisfied" />
</imsss:ruleConditions>
<imsss:ruleAction action="disabled" />
</imsss:preConditionRule>
You can also control how the content controls the LMS. As some parts of SCORM like completion and success status could be based on progress_measure and scoring if completion thresholds are set (for example).
<!-- Sequence Collection used by SCOs -->
<imsss:sequencingCollection>
<imsss:sequencing ID="COMMON_SEQ_RULES">
<!-- Rollup: set to 0 if you don't want these scored. -->
<!--imsss:rollupRules objectiveMeasureWeight="1" /-->
<!-- prevent from accidentally being quto-completed/satisfied -->
<imsss:deliveryControls completionSetByContent="true" objectiveSetByContent="true" />
<!-- Attempt limit here had no effect -->
</imsss:sequencing>
</imsss:sequencingCollection>
I have a one page progression example here: https://github.com/cybercussion/SCOBot/wiki/Single-Pages-Managed-by-LMS-Navigation There may be something to glean off it. I always thought this was an area/gap the community would eventually fill with some builder/tool but since we are talking about 14 years almost now! I started to attempt to address some of this with my Packager app but there simply isn't enough customer request/demand to spend the time on it.
Good Luck.

Error report - SQL Error: ORA-31061: XDB error: XML event error ORA-19202: Error occurred

I have the below error message when I run the query to inject an XML file into a table on Oracle.
Error report -
SQL Error: ORA-31061: XDB error: XML event error
ORA-19202: Error occurred in XML processing
In line 124110683 of orastream:
LPX-00225: end-element tag "title" does not match start-element tag "sue"
The query is
INSERT INTO TESTTABLE2 (xml_file)
(SELECT XMLTYPE(bfilename('EXPORT_DUMPS','WR_2007_20150123103151_DSSHPSH_0002.xml'), nls_charset_id('AL32UTF8')) from dual );
The XML content looks correct. Here the lines 124110601-150, but I don't see anything special at line 83, which should correspond to line 124110683 mentioned in the error message.
<citedWork>PHYSICAL REVIEW B</citedWork>
<doi>10.1103/PhysRevB.68.020403</doi>
</reference>
<reference>
<uid>WOS:000236477800002</uid>
<citedAuthor>Erdinc, A</citedAuthor>
<year>2006</year>
<page>6</page>
<volume>301</volume>
<citedTitle>Multicritical behavior of the antiferromagnetic Blume-Emery-Griffiths model with the repulsive biquadratic coupling in an external magnetic field</citedTitle>
<citedWork>JOURNAL OF MAGNETISM AND MAGNETIC MATERIALS</citedWork>
<doi>10.1016/j.jmmm.2005.06.002</doi>
</reference>
<reference>
<uid>WOS:000236631400004</uid>
<citedAuthor>Keskin, M</citedAuthor>
<year>2006</year>
<page>116</page>
<volume>353</volume>
<citedTitle>Multicritical phase diagrams of the antiferromagnetic spin-3/2 Blume-Capel model</citedTitle>
<citedWork>PHYSICS LETTERS A</citedWork>
<doi>10.1016/j.physleta.2005.12.079</doi>
</reference>
<reference>
<uid>WOS:000237000300021</uid>
<citedAuthor>Keskin, M</citedAuthor>
<year>2006</year>
<page>263</page>
<volume>364</volume>
<citedTitle>Multicritical behavior of the antiferromagnetic spin-3/2 Blume-Emery-Griffiths model</citedTitle>
<citedWork>PHYSICA A-STATISTICAL MECHANICS AND ITS APPLICATIONS</citedWork>
<doi>10.1016/j.physa.2005.08.077</doi>
</reference>
<reference>
<uid>WOS:000255098600003.7</uid>
<citedAuthor>BACKHICH A</citedAuthor>
<year>2001</year>
<page>249</page>
<volume>13</volume>
<citedWork>J PHYS CONDENS MATT</citedWork>
</reference>
<reference>
<uid>WOS:000246760500003.15</uid>
<citedAuthor>KIKUCHI R</citedAuthor>
<year>1979</year>
<citedWork>UNPUB CRYSTALS STAT</citedWork>
</reference>
</references>
<addresses count="2">
<address_name>
<address_spec addr_no="1">
<full_address>Erciyes Univ, Inst Sci, TR-38039 Kayseri, Turkey</full_address>
<organizations count="1">
<organization>Erciyes Univ</organization>
</organizations>
<suborganizations count="1">
<suborganization>Inst Sci</suborganization>
</suborganizations>
<city>Kayseri</city>
<country>Turkey</country>
<zip location="BC">TR-38039</zip>
</address_spec>
</address_name>
<address_name>
<address_spec addr_no="2">
<full_address>Erciyes Univ, Dept Phys, TR-38039 Kayseri, Turkey</full_address>
<organizations count="1">
<organization>Erciyes Univ</organization>
</organizations>
<suborganizations count="1">
<suborganization>Dept Phys</suborganization>
</suborganizations>
<city>Kayseri</city>
<country>Turkey</country>
<zip location="BC">TR-38039</zip>
</address_spec>
</address_name>
</addresses>
<category_info>
<headings count="1">
<heading>Science & Technology</heading>
</headings>
<subheadings count="1">
<subheading>Physical Sciences</subheading>
</subheadings>
<subjects count="4">
<subject ascatype="traditional">Chemistry, Physical</subject>
<subject ascatype="traditional">Physics, Multidisciplinary</subject>
<subject ascatype="extended">Chemistry</subject>
<subject ascatype="extended">Physics</subject>
</subjects>
</category_info>
<keywords count="4">
<keyword>spin-3/2 Blume-Emery-Griffiths model</keyword>
<keyword>cluster variation method</keyword>
<keyword>thermal variations of order parameters</keyword>
<keyword>phase diagrams</keyword>
</keywords>
<abstracts count="1">
<abstract>
<abstract_text count="1">
<p>The critical behaviour of the ferromagnetic spin-3/2 Blume-Emery-Griffiths model with repulsive biquadratic coupling in the absence and presence of an external magnetic field is studied by using the lowest approximation of the cluster variation method, which is identical with the mean-field approximation. Thermal variations of the order parameters are investigated for different values of the interaction parameters and the external magnetic field. The complete phase diagrams of the system are calculated in the (kT /J, K / J), (kT /J, D / J) and (kT /J, H / J) planes. Five new phase diagram topologies are obtained, which are either absent from previous approaches or have gone unnoticed. A detailed discussion and comparison of the phase diagrams is made.</p>
</abstract_text>
</abstract>
</abstracts>
</fullrecord_metadata>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="itemType_wos">
<ids avail="Y">171UI</ids>
<bib_id>62 (3-4): 127-139 MAR-APR 2007</bib_id>
<bib_pagecount type="Journal">124</bib_pagecount>
<reprint_contact>
<address_spec addr_no="1">
<full_address>Erciyes Univ, Inst Sci, TR-38039 Kayseri, Turkey</full_address>
<organizations count="1">
<organization>Erciyes Univ</organization>
</organizations>
<suborganizations count="1">
<suborganization>Inst Sci</suborganization>
</suborganizations>
<city>Kayseri</city>
<country>Turkey</country>
<zip location="BC">TR-38039</zip>
</address_spec>
<names count="1">
<name addr_no="1" reprint="Y" role="author" seq_no="1">
<display_name>Ali Pinar, M.</display_name>
<full_name>Ali Pinar, M.</full_name>
<wos_standard>Pinar, MA</wos_standard>
<first_name>M.</first_name>
<last_name>Ali Pinar</last_name>
<email_addr>keskin#erciyes.edu.tr</email_addr>
</name>
</names>
</reprint_contact>
<keywords_plus count="5">
<keyword>MULTICRITICAL PHASE-DIAGRAMS</keyword>
<keyword>RECURSION METHOD</keyword>
<keyword>ISING-MODEL</keyword>
<keyword>LATTICE</keyword>
<keyword>FIELD</keyword>
</keywords_plus>
</item>
</static_data>
<dynamic_data>
<cluster_related>
<identifiers>
<identifier type="accession_no" value="171UI"/>
<identifier type="issn" value="0932-0784"/>
</identifiers>
</cluster_related>
</dynamic_data>
</REC>
I have no problems with other lighter XML files. This one is almost of 5 GB.
We are running the: ''Oracle Database 11g Enterprise Edition 11.2.0.4.0 64bit Production''
Does anyone knows where the problem could be?
Thanks.

How to hide unwanted measures

AP 4.4.3, APL 2.7.0
Hi,
When defining a post-processed measure we end up with two measures available to us in Active Pivot Live. E.g. the definition below will give us the measures "Yield Curve.SUM" and "Yield Curve.TenorDetail". As we've got a lot of measures like this, we end up with a lot of useless SUM measures cluttering up the interface.
So, since we only need "Yield Curve.TenorDetail", can we somehow hide "Yield Curve.SUM"?
<measure name="Yield Curve" aggregationFunctions="SUM" >
<postProcessor pluginKey="TenorDetail" >
<properties>
<entry key="id" value="TenorDetail" />
<entry key="vectorMeasure" value="Yield Curve.SUM" />
<entry key="analysisDimensionName" value="Tenor" />
</properties>
</postProcessor>
</measure>
You can achieve this behavior by defining subcube properties in the shared context of your cube definition and explicitely list all the measures that you want to be available for the users
For instance the definition below will only show Yield Curve.TenorDetail and no other measure:
<sharedContexts>
<subCubeProperties isAccessGranted="true">
<grantedMeasures>
<measure>Yield Curve.TenorDetail</measure>
</grantedMeasures>
</subCubeProperties>
</sharedContexts>

vxml: defining grammars with equivalent inputs

I am using an engine based on TellMe. I have seen examples of grammars where the user can say one of a few different things that are considered the same. However, all the examples i've seen have been for in-line grammars (which dont work with the vxml engine im using). I want to know how i can change my .grxml file to do this. This is the file:
<?xml version="1.0"?>
<!-- created by Matthew Murdock. Grammars for speech rec menus -->
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0.2006">
<rule id="keep">
<one-of>
<item>exit</item>
<item>exit the system</item>
<item>another</item>
<item>another mailbox</item>
<item>play</item>
<item>play back</item>
</one-of>
</rule>
</grammar>
instead of having 6 items, i want to have 3 items, each having two possible utterances. Any ideas on how i can do this?
A more compact form:
<rule id="exit">
exit <item repeat="0-1">the system</item>
<tag>out.result = "exit"</tag>
</rule>
<rule id="play">
play <item repeat="0-1">back</item>
<tag>out.result = "play"</tag>
</rule>
The answers you want are in the SISR specification which provides a mechanism for attaching meaning to input paths. Rewriting your example:
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
<rule id="keep">
<one-of>
<item>
<one-of>
<item>exit</item>
<item>exit the system</item>
</one-of>
<tag>exit</tag>
</item>
<item>
<one-of>
<item>another</item>
<item>another mailbox</item>
</one-of>
<tag>another</tag>
</item>
<item>
<one-of>
<item>play</item>
<item>play back</item>
</one-of>
<tag>play</tag>
</item>
</one-of>
</rule>
</grammar>
Several things to know:
I chose the literal tag format (notice the tag-format attribute of the grammar element). It could have also been implemented using "semantics/1.0" and the contents of the tag would have looked like: out="exit";
TellMe tag-format values may need to be different, but their development guide implies they follow the standards.
Once you have it working, don't hesitate to create filler grammars (in SRGS speak, rules). Filler rules would be rules without any SI (no tag elements) and contain common phrases people add to responses. For example, a trailing rule that could be added at the end of your grammar:
</one-of>
<item repeat="0-1"><ruleref uri="#trailing"/></item>
</rule>
<rule id="trailing>
<one-of>
<item>please</item>
<item>thank you</item>
</one-of>
</rule>
</grammar>
This would support more natural types of responses. This may or may not be important depending on your calling base. Filler grammars can be very large, but tend to be highly reusable. You can also add filler at the beginning of input. In rich speech applications, a the most significant gain in the tuning process involves updating the grammar to contain the actual phrases spoken by the caller versus what the developer or VUI designer thought would be spoken.
I figured it out. I changed my grammar to look like this:
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en" version="1.0" mode="voice" scope="dialog" tag-format="semantics/1.0-literals">
<rule id="keep">
<one-of>
<item><ruleref id="#exit"/></item>
<item><ruleref id="#play"/></item>
</one-of>
</rule>
<rule id="exit">
<one-of>
<item>exit</item>
<item>exit the system</item>
</one-of>
<tag>out.result = "exit"</tag>
</rule>
<rule id="play">
<one-of>
<item>play</item>
<item>play back</item>
</one-of>
<tag>out.result = "play"</tag>
</rule>
</grammar>
Then, back in my script instead of basing my actions on callerInput (the variable specified in the <field> tag), i based them off of callerInput$.interpretation which holds xml containing whatever i assigned out.result to in the <tag> element of the grammar.
I guess it makes sense to base your actions on the "interpretation" and not the caller's literal input.
NOTE: Because we are working with our own vxml engine we were able to create a method for extracting the interpretation value out of the xml.