/*
* File name: StupidityVisualiserPlugin.java (package eas.users.daniel.stupid)
* Author(s): phoenix
* Java version: 6.0
* Generation date: 05.10.2011 (17:56:10)
* (c) This file and the EAS (Easy Agent Simulation) framework containing it
* is protected by Creative Commons by-nc-sa license. Any altered or
* further developed versions of this file have to meet the agreements
* stated by the license conditions.
* In a nutshell
* -------------
* You are free:
* - to Share -- to copy, distribute and transmit the work
* - to Remix -- to adapt the work
* Under the following conditions:
* - Attribution -- You must attribute the work in the manner specified by the
* author or licensor (but not in any way that suggests that they endorse
* you or your use of the work).
* - Noncommercial -- You may not use this work for commercial purposes.
* - Share Alike -- If you alter, transform, or build upon this work, you may
* distribute the resulting work only under the same or a similar license to
* this one.
* + Detailed license conditions (Germany):
* http://creativecommons.org/licenses/by-nc-sa/3.0/de/
* + Detailed license conditions (unported):
* http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en
* This header must be placed in the beginning of any version of this file.
*/
package eas.users.daniel.stupid;
import java.util.List;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.statistics.HistogramDataset;
import eas.miscellaneous.system.windowFrames.StaticWindow;
import eas.plugins.AbstractDefaultPlugin;
import eas.simulation.Wink;
import eas.simulation.event.EASEvent;
import eas.startSetup.ParCollection;
import eas.startSetup.SingleParameter;
/**
* @author phoenix
*/
public class StupidityVisualiserPlugin extends AbstractDefaultPlugin<StupidEnvironment> {
/**
*
*/
private static final long serialVersionUID = 4420252048406733461L;
StaticWindow diagramWindow;
HistogramDataset dataset;
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#getRequiredPlugins()
*/
@Override
public List<String> getRequiredPlugins() {
// TODO Auto-generated method stub
return null;
}
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#getGenericParams()
*/
@Override
public List<SingleParameter> getParameters() {
// TODO Auto-generated method stub
return null;
}
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#id()
*/
@Override
public String id() {
return "StupidityVisualiserPlugin";
}
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#runBeforeSim(eas.simulation.environment.
* AbstractEnvironment, eas.startSetup.ParCollection)
*/
@Override
public void runBeforeSimulation(StupidEnvironment env, ParCollection params) {
dataset = new HistogramDataset();
// diagramWindow = new StaticWindow("Bug-Counter", 350, 350, true);
DefaultCategoryDataset data = new DefaultCategoryDataset();
JFreeChart cs = ChartFactory.createLineChart("Titel", "Label 1", "label 2", data, PlotOrientation.HORIZONTAL, false, false, false);
// final JFreeChart chart = ChartFactory.createHistogram(
// "Stupidity of Agents", // chart title
// "Label A", // domain axis label
// "Label B", // range axis label
// dataset, // data
// PlotOrientation.VERTICAL, // orientation
// true, // include legend
// true, // tooltips
// false // urls
// );
//
//
diagramWindow.setVisible(true);
// diagramWindow.getPanel().setImg(cs.createBufferedImage(350, 350));
final CategoryPlot plot = cs.getCategoryPlot();
final CategoryAxis axis = plot.getDomainAxis();
axis.setCategoryLabelPositions(CategoryLabelPositions
.createUpRotationLabelPositions(Math.PI / 8.0));
}
/*
* (non-Javadoc)
* @see
* eas.plugins.Plugin#runAfterSim(eas.simulation.environment.AbstractEnvironment
* , eas.startSetup.ParCollection)
*/
@Override
public void runAfterSimulation(StupidEnvironment env, ParCollection params) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#runDuringSim(eas.simulation.environment.
* AbstractEnvironment, eas.simulation.Wink, eas.startSetup.ParCollection)
*/
@Override
public void runDuringSimulation(StupidEnvironment env, Wink currentSimTime,
ParCollection params) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
* @see eas.plugins.Plugin#handleEvent(eas.simulation.event.EASEvent,
* eas.simulation.environment.AbstractEnvironment, eas.simulation.Wink,
* eas.startSetup.ParCollection)
*/
@Override
public void handleEvent(EASEvent e, StupidEnvironment env,
Wink lastSimTime, ParCollection params) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see eas.plugins.Plugin#getSupportedPlugins()
*/
@Override
public List<String> getSupportedPlugins() {
// TODO Auto-generated method stub
return null;
}
@Override
public void onSimulationResumed(StupidEnvironment env, Wink resumeTime,
ParCollection params) {
}
}