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
6829ab85
Commit
6829ab85
authored
Nov 25, 2021
by
Julian Zobel
🦄
Browse files
Added a field for experiments db with "fisnihed withput errors"
parent
8ddb64ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/simengine/Simulator.java
View file @
6829ab85
...
...
@@ -289,7 +289,7 @@ public class Simulator implements RandomGeneratorComponent, GlobalComponent {
so
.
simulationFinished
();
}
ExperimentDAO
.
simulationFinished
();
ExperimentDAO
.
simulationFinished
(
finishedWithoutError
);
}
/**
...
...
src/de/tud/kom/p2psim/impl/topology/component/UAVTopologyComponent.java
View file @
6829ab85
...
...
@@ -175,13 +175,14 @@ public class UAVTopologyComponent extends AbstractTopologyComponent implements S
if
(
this
.
position
.
getAltitude
()
!=
0
)
{
this
.
setState
(
UAVstate
.
CRASHED
);
Monitor
.
log
(
this
.
getClass
(),
Level
.
WARN
,
"[UAVTopologyComponent] UAV "
+
getUAVComponent
().
getHost
().
getId
()
+
" crashed at "
+
getRealPosition
(),
""
);
PositionVector
l
=
getCurrentLocation
();
l
.
setAltitude
(
0
);
this
.
updateCurrentLocation
(
l
);
uavOverlayComponent
.
shutdown
();
shutdownCommunication
();
Monitor
.
log
(
this
.
getClass
(),
Level
.
WARN
,
"[UAVTopologyComponent] UAV "
+
getUAVComponent
().
getHost
().
getId
()
+
" crashed at "
+
getRealPosition
(),
""
);
}
else
{
this
.
setState
(
UAVstate
.
OFFLINE
);
...
...
src/de/tud/kom/p2psim/impl/util/db/dao/metric/ExperimentDAO.java
View file @
6829ab85
...
...
@@ -106,12 +106,14 @@ public class ExperimentDAO extends DAO {
}
/** Called by the {@link Time} when the simulation is shut down. */
public
static
void
simulationFinished
()
{
public
static
void
simulationFinished
(
boolean
finishedWithoutError
)
{
// If there is no experiment object, no measurements have been made,
// and hence, there is no reason to contact the database.
if
(
experiment
==
null
)
return
;
updateFinishedWithoutError
(
finishedWithoutError
);
updateEndDate
();
commitQueue
();
finishCommits
();
...
...
@@ -125,4 +127,10 @@ public class ExperimentDAO extends DAO {
experiment
.
setEndDate
(
new
Date
());
update
(
experiment
);
}
private
static
void
updateFinishedWithoutError
(
boolean
finishedWithoutError
)
{
experiment
.
setFinishedWithoutErrors
(
finishedWithoutError
);
update
(
experiment
);
}
}
src/de/tud/kom/p2psim/impl/util/db/metric/Experiment.java
View file @
6829ab85
...
...
@@ -48,6 +48,11 @@ public class Experiment {
* The end date of this experiment
*/
private
Date
endDate
;
/**
* If the simulation finished without errors
*/
private
boolean
finishedWithoutError
;
/**
* The description of this experiment (easy readable)
...
...
@@ -90,6 +95,7 @@ public class Experiment {
this
.
name
=
name
;
this
.
system
=
system
;
this
.
workload
=
workload
;
this
.
finishedWithoutError
=
null
;
}
public
Experiment
()
{
...
...
@@ -122,6 +128,10 @@ public class Experiment {
public
String
getWorkload
()
{
return
workload
;
}
public
boolean
hasFinishedWithoutErrors
()
{
return
finishedWithoutError
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
...
...
@@ -146,6 +156,10 @@ public class Experiment {
public
void
setWorkload
(
String
workload
)
{
this
.
workload
=
workload
;
}
public
void
setFinishedWithoutErrors
(
boolean
noerrors
)
{
finishedWithoutError
=
noerrors
;
}
public
Date
getEndDate
()
{
return
endDate
;
...
...
@@ -159,6 +173,6 @@ public class Experiment {
public
String
toString
()
{
return
"Experiment [id="
+
id
+
", seed="
+
seed
+
", date="
+
date
+
", endDate="
+
endDate
+
", name="
+
name
+
", system="
+
system
+
", workload="
+
workload
+
"]"
;
+
system
+
", workload="
+
workload
+
", no Errors="
+
finishedWithoutError
+
"]"
;
}
}
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