All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.massisframework.massis.ai.sposh.senses.MentalStateContains Maven / Gradle / Ivy

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.massisframework.massis.ai.sposh.senses;


import com.massisframework.massis.ai.sposh.SimulationContext;
import cz.cuni.amis.pogamut.sposh.executor.Param;
import cz.cuni.amis.pogamut.sposh.executor.PrimitiveInfo;

/**
 * Returns if the specified mental state contains the provided value
 *
 * @author rpax
 */
@PrimitiveInfo(name = "Mental State Contains", description = "Returns if the specified mental state contains the provided value")
public class MentalStateContains extends SimulationSense {

    public MentalStateContains(SimulationContext ctx)
    {
        super(ctx);
    }

    public Boolean query(
            @Param("$mentalVariable") String mentalVariable,
            @Param("$value") Integer value)
    {
        Object valueRetrieved = this.ctx.getMentalState().get(mentalVariable);
        return value.equals(valueRetrieved);

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy