-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
131 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
application.version=1.3 | ||
application.version=1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package io | ||
|
||
import core.simulator.Time | ||
import java.io.File | ||
import java.io.FileWriter | ||
import java.io.Writer | ||
import java.time.Instant | ||
|
||
/** | ||
* Created on 27-10-2017 | ||
* | ||
* @author David Fialho | ||
* | ||
* Data class to hold metadata information. | ||
* It also provides methods to output the information to a file or a stream. | ||
*/ | ||
data class Metadata( | ||
val version: String, | ||
val startInstant: Instant, | ||
val finishInstant: Instant, | ||
val topologyFilename: String, | ||
val stubsFilename: String?, | ||
val destinationID: Int, | ||
val minDelay: Time, | ||
val maxDelay: Time, | ||
val threshold: Time | ||
) { | ||
|
||
/** | ||
* Prints metadata information using the specified writer. | ||
*/ | ||
fun print(writer: Writer) { | ||
|
||
writer.apply { | ||
write("version = $version\n") | ||
write("start datetime = $startInstant\n") | ||
write("finish datetime = $finishInstant\n") | ||
write("topology file = $topologyFilename\n") | ||
if (stubsFilename != null) write("stubs file = $stubsFilename\n") | ||
write("destination = $destinationID\n") | ||
write("min delay = $minDelay\n") | ||
write("max delay = $maxDelay\n") | ||
write("threshold = $threshold\n") | ||
} | ||
} | ||
|
||
/** | ||
* Prints metadata information to the specified file. | ||
*/ | ||
fun print(outputFile: File) { | ||
FileWriter(outputFile).use { | ||
print(it) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters