public class PolicyContainer extends ConcurrentSkipListSet<AbstractPolicy> implements Comparable<PolicyContainer>
Title: CASA Agent Infrastructure
Description:
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Company: Knowledge Science Group, University of Calgary
Modifier and Type | Field and Description |
---|---|
private String |
name |
private static long |
serialVersionUID |
private String |
type |
Constructor and Description |
---|
PolicyContainer(String type,
String name) |
ceiling, clear, comparator, contains, descendingIterator, descendingSet, equals, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, removeAll, size, spliterator, subSet, subSet, tailSet, tailSet
hashCode
addAll, containsAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, hashCode, retainAll, toArray, toArray
parallelStream, removeIf, stream
private static final long serialVersionUID
private String type
private String name
public Collection<AbstractPolicy> getPolicies()
public void setType(String type)
public boolean add(AbstractPolicy policy)
add
in interface Collection<AbstractPolicy>
add
in interface Set<AbstractPolicy>
add
in class ConcurrentSkipListSet<AbstractPolicy>
policy:
- an Object that must be a Policypublic void addPolicy(AbstractPolicy p)
public void addPolicies(AbstractPolicy[] p)
public void addPolicies(Collection<AbstractPolicy> p)
public StatusObject<List<Object>> applyPolicies(PolicyAgentInterface agent, AbstractCollection<Pair<Conversation,AbstractPolicy>> applicablePolicies, Event event, Map<String,LispObject> map) throws Exception
agent
- the agent that is the context (is going to execute) the policies.applicablePolicies
- the policies to apply.event
- the event that the policies are applied to.Exception
- if one of the policy applicationsException
- if an exception occurs in the application, the process is interrupted and the exception is thrown.AbstractPolicy#apply(PolicyAgentInterface, Status, Vector, Event, Object)
,
#filterPolicies(PolicyAgentInterface, Vector)
,
#sortPolicies(PolicyAgentInterface, Vector)
void updatePolicies(PolicyAgentInterface agent, AbstractCollection<Pair<Conversation,AbstractPolicy>> applicablePolicies, Map<String,LispObject> map)
agent
- applicablePolicies
- map
- public static Status conclude(PolicyAgentInterface agent, StatusObject<List<Object>> stat)
ApplicablePoliciesList
protected static StatusObject<List<Object>> combineStatus(StatusObject<List<Object>> s1, StatusObject<List<Object>> s2)
s1
- s2
- public Vector<AbstractPolicy> findApplicable(PolicyAgentInterface agent, Event event, Map<String,LispObject> map)
protected Vector<Pair<Conversation,AbstractPolicy>> sortPolicies(PolicyAgentInterface agent, AbstractCollection<Pair<Conversation,AbstractPolicy>> applicable)
protected void filterPolicies(PolicyAgentInterface agent, AbstractCollection<Pair<Conversation,AbstractPolicy>> applicablePolicies)
public String toString()
toString
in class AbstractCollection<AbstractPolicy>
public static <T extends AbstractPolicy> String toString(Vector<T> v)
public String toString(int indent)
public <T extends AbstractPolicy> String toString(AbstractCollection<Pair<Conversation,T>> v)
public static <T extends AbstractPolicy> String toString(Collection<T> v, int indent)
public boolean hasPolicyGUI()
public JComponent getPolicyGUI(SocialCommitmentsStore store)
public String getType()
public String getName()
public PolicyContainer clone()
clone
in class ConcurrentSkipListSet<AbstractPolicy>
public void destroy()
public int compareTo(PolicyContainer o)
compareTo
in interface Comparable<PolicyContainer>