public abstract class ReputationModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
MainSeriesKey |
Constructor and Description |
---|
ReputationModel() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addChartSeries(SimulatorModel simulatorModel,
SimulatorPanel simulatorPanel)
Method, called at the start of the simulation, to add or clear
all the series within the Chart Datasets (XYSeriesCollection),
that are used from the reputation model.
|
org.jfree.chart.JFreeChart |
getChartByKey(SimulatorPanel simulatorPanel,
java.lang.String key)
Method to retrieve the JFreeChart containing the chart series with name "key".
|
org.jfree.data.xy.XYSeriesCollection |
getDataSetByKey(java.lang.String key)
Method to retrieve the XYSeriesCollection by key name.
|
java.lang.String |
getMainSeriesKey() |
abstract void |
initializeUserData(SimUser user)
Method, called at the start of the simulation, for every simulated
user, to initialize all the components and variables from
SimUser ,
that the reputation model will be using. |
abstract void |
recalculateReputation(SimUser user,
float[] rating)
Method, called with every rating, to re-estimate the values
from
SimUser , that the reputation model will be using. |
void |
setMainSeriesKey(java.lang.String mainSeriesKey) |
abstract void |
updateReputationSeries(SimUser user,
float[] rating,
SimulatorPanel simulatorPanel)
Method, called with every rating, to update all Series from
SimUser, that the reputation model will be using and call the
ChartController to update the UI charts.
|
void |
updateSeriesBykey(java.lang.String key,
SimUser user,
SimulatorPanel simulatorPanel)
Method, called with every rating, to update a specific Series from
SimUser , that the reputation model will be using and call the
ChartController to update the UI chart. |
public abstract void initializeUserData(SimUser user)
SimUser
,
that the reputation model will be using.
This method is called for all users involved in a scenario, when the simulation starts.
user
- the SimUser
to be initialized.public abstract void recalculateReputation(SimUser user, float[] rating)
SimUser
, that the reputation model will be using.
This method is called for every SimpleDirectionalRate
operation in a scenario to apply the rating.
user
- the SimUser
receiving the rating.rating
- the ActionSequence
record for the rating.public abstract void updateReputationSeries(SimUser user, float[] rating, SimulatorPanel simulatorPanel)
This method is called for every SimpleDirectionalRate
operation in a scenario to update the charts
with the latest reputation values after recalculateReputation(SimUser, float[])
is invoked.
user
- the SimUser
receiving the rating.rating
- the ActionSequence
record for the rating.simulatorPanel
- the UI's SimulatorPanel
that is needed in order to access and update the charts.public abstract void addChartSeries(SimulatorModel simulatorModel, SimulatorPanel simulatorPanel)
simulatorModel
- the SimulatorModel
containing the chart dataSets to be added.simulatorPanel
- the UI's SimulatorPanel
that is needed in order to access the charts.public java.lang.String getMainSeriesKey()
public void setMainSeriesKey(java.lang.String mainSeriesKey)
public void updateSeriesBykey(java.lang.String key, SimUser user, SimulatorPanel simulatorPanel)
SimUser
, that the reputation model will be using and call the
ChartController
to update the UI chart.key
- the key name of the dataset stored in the XYSeriesCollectionuser
- the SimUser
receiving the rating.simulatorPanel
- the UI's SimulatorPanel
that is needed in order to access the charts.public org.jfree.data.xy.XYSeriesCollection getDataSetByKey(java.lang.String key)
key
- key name of the dataset stored in the XYSeriesCollectionpublic org.jfree.chart.JFreeChart getChartByKey(SimulatorPanel simulatorPanel, java.lang.String key)
simulatorPanel
- the UI's SimulatorPanel
that is needed in order to access the charts.key
- key name of the dataset stored in the XYSeriesCollection