Class DynamicScoringPreferenceAggregator<T>
java.lang.Object
org.tweetyproject.preferences.aggregation.DynamicScoringPreferenceAggregator<T>
- Type Parameters:
 T- generic preference order type
- All Implemented Interfaces:
 DynamicPreferenceAggregator<T>
- Direct Known Subclasses:
 DynamicBordaScoringPreferenceAggregator,DynamicPluralityScoringPreferenceAggregator,DynamicVetoScoringPreferenceAggregator
public abstract class DynamicScoringPreferenceAggregator<T>
extends Object
implements DynamicPreferenceAggregator<T>
This Demo-class provides a basic implementation similar to the
 ScoringPreferenceAggregator but dynamic aggregation instead of static
- Author:
 - Bastian Wolf
 
- 
Constructor Summary
ConstructorsConstructorDescriptionConstructor with given weight vector - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(UpdateListener<T> listener) adds a listener to this dynamic preference aggregatoraggregate(List<PreferenceOrder<T>> input) This method aggregates the given preference orders according to the WeightVector used within constructionvoidremoveListener(UpdateListener<T> listener) removes a listener from this dynamic preference aggregatorThe update-method for dynamically changing the input for preference aggregationupdate(UpdateStream<T> stream, List<PreferenceOrder<T>> input) this method extends the update-functionality with input-streams consisting of Update-elements 
- 
Constructor Details
- 
DynamicScoringPreferenceAggregator
Constructor with given weight vector- Parameters:
 v- the weight vector
 
 - 
 - 
Method Details
- 
aggregate
This method aggregates the given preference orders according to the WeightVector used within construction- Specified by:
 aggregatein interfaceDynamicPreferenceAggregator<T>- Parameters:
 input- the array of preference orders to be aggregated- Returns:
 - the final result as a preference order
 
 - 
update
public PreferenceOrder<T> update(Update<T> update, List<PreferenceOrder<T>> input) throws IndexOutOfBoundsException, NullPointerException The update-method for dynamically changing the input for preference aggregation- Specified by:
 updatein interfaceDynamicPreferenceAggregator<T>- Parameters:
 update- the update element containing the changes to be appliedinput- some input- Returns:
 - a preference order
 - Throws:
 IndexOutOfBoundsExceptionNullPointerException
 - 
update
this method extends the update-functionality with input-streams consisting of Update-elements- Parameters:
 stream- the input stream with the Update-elementsinput- some input- Returns:
 - the newly aggregated preference order after all updates are applied
 
 - 
addListener
adds a listener to this dynamic preference aggregator- Specified by:
 addListenerin interfaceDynamicPreferenceAggregator<T>- Parameters:
 listener- an update listener
 - 
removeListener
removes a listener from this dynamic preference aggregator- Specified by:
 removeListenerin interfaceDynamicPreferenceAggregator<T>- Parameters:
 listener- an update listener
 
 -