Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 //----------------------------------------------------------------------------
 // Copyright (C) 2003  Rafael H. Bordini, Jomi F. Hubner, et al.
 // 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // version 2.1 of the License, or (at your option) any later version.
 // 
 // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// 
// To contact the authors:
// http://www.inf.ufrgs.br/~bordini
// http://www.das.ufsc.br/~jomi
//
//----------------------------------------------------------------------------
package jason.stdlib;

Internal action: .drop_all_events.

Description: removes all desires that the agent has not yet committed to. No event is produced.

This action changes the agent's circumstance structure by simply emptying the whole set of events (E). This action is complementary to .drop_all_desires and .drop_all_intentions, in case all entries are to be removed from the set of events but not from the set of intentions.

Example:

  • .drop_all_events.

public class drop_all_events extends DefaultInternalAction {
    @Override public int getMinArgs() { return 0; }
    @Override public int getMaxArgs() { return 0; }
    
    @Override
    public Object execute(TransitionSystem tsUnifier unTerm[] argsthrows Exception {
        checkArguments(args);
        ts.getC().clearEvents();
        ts.getC().clearPendingEvents();
        return true;
    }
New to GrepCode? Check out our FAQ X