lp.unit
Class TransformedEvolp
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
java.util.LinkedHashSet<LpRule>
lp.unit.GeneralizedLogicProgram
lp.unit.TransformedEvolp
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<LpRule>, Collection<LpRule>, Set<LpRule>, LogicProgram
public class TransformedEvolp
- extends GeneralizedLogicProgram
Represents the normal logic program that was constructed from an evolving
logic program. It can be used as an ordinary logic program but it also offers
the possibility to remember the types and group numbers of the rules in it. A
rule of a specific type can be added by using the
add(LpRule, int, TransEvolpRuleType)
method. The
getGroup(int, TransEvolpRuleType)
will return all rules that were
added to a specific group with a specific type.
- Version:
- 1.0.0
- Author:
- Martin Slota
- See Also:
EvolpTransformer.transform(EvolpProgram)
,
Serialized Form
Constructor Summary |
TransformedEvolp()
Creates a new instance of TransformedEvolp . |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ruleGroups
private final Map<String,LogicProgram> ruleGroups
- A mapping of groups and types to logic programs.
maxGroup
private int maxGroup
- Maximum group used in this transformed program.
TransformedEvolp
public TransformedEvolp()
- Creates a new instance of
TransformedEvolp
. It is intially
empty.
add
public boolean add(LpRule rule,
int group,
TransEvolpRuleType type)
- Adds the rule
rule
to this program and remembers it to be in the
group no. group
and of type type
.
- Parameters:
rule
- the rule to addgroup
- number of the group to which the rule belongstype
- type of the rule
- Returns:
true
if this program did not already contain the
specified rule
getGroup
public LogicProgram getGroup(int group,
TransEvolpRuleType type)
- Returns a
LogicProgram
containing all rules from group no.
group
and of the type type
.
- Parameters:
group
- number of the group from which rules should be returnedtype
- type of the rules that should returned
- Returns:
- as specified above
getMaxGroup
public int getMaxGroup()
- Returns the maximum number of group used in this transformed program.
- Returns:
- as specified above