Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
ae7828ba
Commit
ae7828ba
authored
Jan 11, 2017
by
Marc Schiller
Browse files
Get users via Oracle for debug graph.
parent
dce2af64
Changes
1
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/fiveg/utils/Graph.java
View file @
ae7828ba
...
...
@@ -28,25 +28,35 @@ import org.jfree.data.category.DefaultCategoryDataset;
import
org.jfree.ui.ApplicationFrame
;
import
de.tud.kom.p2psim.impl.topology.views.fiveg.models.AbstractModel
;
import
de.tudarmstadt.maki.simonstrator.api.Event
;
import
de.tudarmstadt.maki.simonstrator.api.EventHandler
;
import
de.tudarmstadt.maki.simonstrator.api.Oracle
;
/**
* A simple graph for debugging the models
* @author Marc Schiller
* @version 1.0, 15 Dec 2016
*/
public
class
Graph
extends
ApplicationFrame
{
public
class
Graph
extends
ApplicationFrame
implements
EventHandler
{
AbstractModel
model
=
null
;
public
Graph
()
{
super
(
"Debug Graph"
);
// TODO: Schließen ohne simonstrator zu killen.
Event
.
scheduleImmediately
(
this
,
null
,
0
);
//FIXME: Don't close Simonstrator when closing debug window
}
public
void
setModel
(
AbstractModel
model
)
{
this
.
model
=
model
;
}
@Override
public
void
eventOccurred
(
Object
content
,
int
type
)
{
if
(
model
.
getDebug
())
{
DefaultCategoryDataset
dataset
=
new
DefaultCategoryDataset
();
// TODO: Get max users.
for
(
int
i
=
0
;
i
<=
500
;
i
+=
1
)
{
System
.
out
.
println
(
model
.
getDouble
(
i
));
//FIXME: Don't get users via Oracle
for
(
int
i
=
0
;
i
<
Oracle
.
getAllHosts
().
size
();
i
+=
1
)
{
dataset
.
addValue
(
model
.
getDouble
(
i
),
"Value"
,
Integer
.
toString
(
i
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment