amharrison / jactr

-old - jACT-R Bundles
http://jact-r.org/
7 stars 5 forks source link

When matching buffers in a production, equal slots are not considered equal when modifying slots via extensions. #27

Closed curranw closed 8 years ago

curranw commented 8 years ago

When modifying slots via an extension, i.e.

Map<String, Object> data =  getNewData();
ChunkUtilities.manipulateChunkLater(_trackerBuffer, new ChunkUtilities.IChunkModifier() {
    public void modify(IChunk chunk, IActivationBuffer buffer)
    {
        ISymbolicChunk sc = chunk.getSymbolicChunk();
        for (Map.Entry<String, Object> entry : data.entrySet())
        {
            IMutableSlot slot = (IMutableSlot) sc.getSlot(entry.getKey());
            slot.setValue(entry.getValue());
        }
    }
};

equal slots are not considered equal if the entry contains a string or a character. JACT-R logs give:

ros-data-34.step-finished=OMG does not match step-finished = OMG 

and generated chunks look like:

<chunk name="ros-data-34" type="ros-data" >
        <slot name="step-finished" equals="'OMG'"/>
</chunk>

some java String shenanigans are including extra quotation marks.