From 7d791d415706dee41ea18ceb1ca2b0169f8448b2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 8 Aug 2017 21:23:07 +0200 Subject: Fix copyright headers and license This change fixes the copyright headers and license of the project in order to assign the copyright to atlarge-research. --- .../nl/atlarge/opendc/experiment/Experiment.kt | 32 +++++++++ .../atlarge/opendc/experiment/ExperimentRunner.kt | 32 +++++++++ .../kotlin/nl/atlarge/opendc/experiment/Job.kt | 34 ++++++++++ .../nl/atlarge/opendc/experiment/Scheduler.kt | 43 ++++++++++++ .../kotlin/nl/atlarge/opendc/experiment/Task.kt | 64 ++++++++++++++++++ .../kotlin/nl/atlarge/opendc/experiment/User.kt | 37 ++++++++++ .../kotlin/nl/atlarge/opendc/sampler/Sampler.kt | 39 +++++++++++ .../nl/atlarge/opendc/simulator/Simulator.kt | 68 +++++++++++++++++++ .../atlarge/opendc/simulator/SimulatorContext.kt | 37 ++++++++++ .../main/kotlin/nl/atlarge/opendc/topology/Edge.kt | 79 ++++++++++++++++++++++ .../kotlin/nl/atlarge/opendc/topology/Entity.kt | 37 ++++++++++ .../kotlin/nl/atlarge/opendc/topology/Graph.kt | 47 +++++++++++++ .../main/kotlin/nl/atlarge/opendc/topology/Node.kt | 51 ++++++++++++++ .../opendc/topology/container/DataCenter.kt | 35 ++++++++++ .../atlarge/opendc/topology/container/rack/Rack.kt | 36 ++++++++++ .../atlarge/opendc/topology/container/rack/Slot.kt | 32 +++++++++ .../atlarge/opendc/topology/container/room/Room.kt | 35 ++++++++++ .../nl/atlarge/opendc/topology/machine/Cpu.kt | 37 ++++++++++ .../nl/atlarge/opendc/topology/machine/Gpu.kt | 37 ++++++++++ .../nl/atlarge/opendc/topology/machine/Machine.kt | 36 ++++++++++ .../opendc/topology/machine/ProcessingUnit.kt | 49 ++++++++++++++ .../atlarge/opendc/topology/network/NetworkUnit.kt | 34 ++++++++++ .../nl/atlarge/opendc/topology/power/PowerUnit.kt | 36 ++++++++++ .../atlarge/opendc/topology/storage/StorageUnit.kt | 34 ++++++++++ .../nl/tudelft/opendc/experiment/Experiment.kt | 32 --------- .../tudelft/opendc/experiment/ExperimentRunner.kt | 32 --------- .../kotlin/nl/tudelft/opendc/experiment/Job.kt | 34 ---------- .../nl/tudelft/opendc/experiment/Scheduler.kt | 43 ------------ .../kotlin/nl/tudelft/opendc/experiment/Task.kt | 64 ------------------ .../kotlin/nl/tudelft/opendc/experiment/User.kt | 37 ---------- .../kotlin/nl/tudelft/opendc/sampler/Sampler.kt | 39 ----------- .../nl/tudelft/opendc/simulator/Simulator.kt | 68 ------------------- .../tudelft/opendc/simulator/SimulatorContext.kt | 37 ---------- .../main/kotlin/nl/tudelft/opendc/topology/Edge.kt | 79 ---------------------- .../kotlin/nl/tudelft/opendc/topology/Entity.kt | 37 ---------- .../kotlin/nl/tudelft/opendc/topology/Graph.kt | 47 ------------- .../main/kotlin/nl/tudelft/opendc/topology/Node.kt | 51 -------------- .../opendc/topology/container/DataCenter.kt | 35 ---------- .../tudelft/opendc/topology/container/rack/Rack.kt | 36 ---------- .../tudelft/opendc/topology/container/rack/Slot.kt | 32 --------- .../tudelft/opendc/topology/container/room/Room.kt | 35 ---------- .../nl/tudelft/opendc/topology/machine/Cpu.kt | 37 ---------- .../nl/tudelft/opendc/topology/machine/Gpu.kt | 37 ---------- .../nl/tudelft/opendc/topology/machine/Machine.kt | 36 ---------- .../opendc/topology/machine/ProcessingUnit.kt | 49 -------------- .../tudelft/opendc/topology/network/NetworkUnit.kt | 34 ---------- .../nl/tudelft/opendc/topology/power/PowerUnit.kt | 36 ---------- .../tudelft/opendc/topology/storage/StorageUnit.kt | 34 ---------- 48 files changed, 1001 insertions(+), 1001 deletions(-) create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Experiment.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/ExperimentRunner.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Job.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Scheduler.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Task.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/User.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/sampler/Sampler.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/Simulator.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/SimulatorContext.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Edge.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Entity.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Graph.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/DataCenter.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Rack.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Slot.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/room/Room.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Cpu.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Gpu.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Machine.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/ProcessingUnit.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/network/NetworkUnit.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/power/PowerUnit.kt create mode 100644 opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/storage/StorageUnit.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Experiment.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/ExperimentRunner.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Job.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Scheduler.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Task.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/User.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/sampler/Sampler.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/Simulator.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/SimulatorContext.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Edge.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Entity.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Graph.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Node.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/DataCenter.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Rack.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Slot.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/room/Room.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Cpu.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Gpu.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Machine.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/ProcessingUnit.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/network/NetworkUnit.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/power/PowerUnit.kt delete mode 100644 opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/storage/StorageUnit.kt (limited to 'opendc-core/src/main') diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Experiment.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Experiment.kt new file mode 100644 index 00000000..7638b2c8 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Experiment.kt @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +/** + * A simulation of multiple simultaneous workloads running on top of a topology. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +class Experiment {} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/ExperimentRunner.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/ExperimentRunner.kt new file mode 100644 index 00000000..bb38de99 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/ExperimentRunner.kt @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +/** + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface ExperimentRunner { +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Job.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Job.kt new file mode 100644 index 00000000..e265a031 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Job.kt @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +/** + * A job that is submitted to a cloud network, which consists of one or multiple [Task]s. + * + * @param owner The user to which the job belongs. + * @param tasks The tasks of which the job consists. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Job(val owner: User, val tasks: Collection) diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Scheduler.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Scheduler.kt new file mode 100644 index 00000000..713605e4 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Scheduler.kt @@ -0,0 +1,43 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +import nl.atlarge.opendc.topology.Entity +import nl.atlarge.opendc.topology.Node + +/** + * A task scheduler that is coupled to an [Entity] in the topology of the cloud network. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Scheduler { + /** + * Schedule the given jobs for the given entity. + * + * @param node The node in the cloud network topology representing the entity. + * @param jobs The jobs that have been submitted to the cloud network. + */ + fun schedule(node: Node, jobs: Set) +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Task.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Task.kt new file mode 100644 index 00000000..ec2eb2fa --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/Task.kt @@ -0,0 +1,64 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +/** + * A task represents some computation that is part of a [Job]. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Task( + val id: Int, + val dependencies: Set, + val flops: Long +) { + /** + * The remaining amount of flops to compute. + */ + var remaining: Long = flops + private set + + /** + * A flag to indicate whether the task is finished. + */ + var finished: Boolean = false + private set + + /** + * Consume the given amount of flops of this task. + * + * @param flops The total amount of flops to consume. + */ + fun consume(flops: Long) { + if (finished) + return + if (remaining <= flops) { + finished = true + remaining = 0 + } else { + remaining -= flops + } + } +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/User.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/User.kt new file mode 100644 index 00000000..d97b980b --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/experiment/User.kt @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.experiment + +import nl.atlarge.opendc.topology.Node + +/** + * A user of a cloud network that provides [Job]s for the simulation. + * + *

Each [User] in a simulation has its own logical view of the cloud network which is used to route its jobs in the + * physical network. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class User(val id: Int, val name: String, val view: Node<*>) {} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/sampler/Sampler.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/sampler/Sampler.kt new file mode 100644 index 00000000..2d6d4dc8 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/sampler/Sampler.kt @@ -0,0 +1,39 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.sampler + +/** + * A sampler generates data points (samples) of the simulation based on the events that occur to [Entity] instances that + * are part of the simulation. + * + *

[Sampler]s work by observing [Entity] instances in the simulation and transforming this stream of events into a + * stream of data points. + * + *

An example would be a sampler that tracks [Machine] occupation per time unit, which is achieved by observing the + * [Entity]'s event stream and filtering for [JobAssignment] events. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Sampler diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/Simulator.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/Simulator.kt new file mode 100644 index 00000000..07db1e4c --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/Simulator.kt @@ -0,0 +1,68 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.simulator + +import nl.atlarge.opendc.topology.Entity + +/** + * A simulator that simulates a single entity in the topology of a cloud network. + * + * @param entity The entity to simulate. + * @param ctx The context in which the simulation is run. + * @param The type of entity to simulate. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +abstract class Simulator(val entity: E, val ctx: SimulatorContext) { + /** + * This method is invoked at least once before a tick. This allows the [Simulator] to setup its state before a tick + * event. + * + *

The pre-tick consists of multiple sub-cycles in which all messages which have been sent + * in the previous sub-cycle can optionally be processed in the sub-cycle by the receiving [Simulator]. + */ + fun preTick() {} + + /** + * This method is invoked once per tick, which allows the [Simulator] to process events and simulate an entity in a + * cloud network. + */ + fun tick() {} + + /** + * This method is invoked at least once per tick. This allows the [Simulator] to do work after a tick. + * + *

Like the pre-tick, the post-tick consists of multiple sub-cycles in which all messages which have been sent + * in the previous sub-cycle can optionally be processed in the sub-cycle by the receiving [Simulator]. + */ + fun postTick() {} + + /** + * Send the given message to the given [Entity] for processing. + * + * @param destination The entity to send the message to. + * @param message The message to send to the entity. + */ + fun send(destination: Entity, message: Any?) {} +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/SimulatorContext.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/SimulatorContext.kt new file mode 100644 index 00000000..1ddfbc6a --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/simulator/SimulatorContext.kt @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.simulator + +/** + * The context in which a [Simulator] runs. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +class SimulatorContext { + /** + * The current tick of the simulation. + */ + var tick: Long = 0 +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Edge.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Edge.kt new file mode 100644 index 00000000..de5bb0d4 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Edge.kt @@ -0,0 +1,79 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology + +/** + * An edge that represents a connection between exactly two instances of [Node]. + * Instances of [Edge] may be either directed or undirected. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Edge { + /** + * The label of this edge. + */ + val label: T + + /** + * An [Edge] that is directed, having a source and destination [Node]. + */ + interface Directed: Edge { + /** + * The source of the edge. + */ + val from: Node<*> + + /** + * The destination of the edge. + */ + val to: Node<*> + } + + /** + * An [Edge] that is undirected. + */ + interface Undirected: Edge + + /** + * Return the [Node] at the opposite end of this [Edge] from the + * specified node. + * + * Throws [IllegalArgumentException] if node is + * not incident to this edge. + * + * @param node The node to get the opposite of for this edge pair. + * @return The node at the opposite end of this edge from the specified node. + * @throws IllegalArgumentException if node is not incident to this edge. + */ + fun opposite(node: Node<*>): Node<*> + + /** + * Return a [Pair] representing this edge consisting of both incident nodes. + * Note that the pair is in no particular order. + * + * @return The edge represented as pair of both incident nodes. + */ + fun endpoints(): Pair, Node<*>> +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Entity.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Entity.kt new file mode 100644 index 00000000..ef9f3593 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Entity.kt @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology + +/** + * An entity in a cloud network. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Entity { + /** + * A unique identifier of this node within the topology represented as a [Int]. + */ + val id: Int +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Graph.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Graph.kt new file mode 100644 index 00000000..a87957e3 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Graph.kt @@ -0,0 +1,47 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology + +/** + * A graph data structure which represents the logical topology of a cloud network consisting of one or more data + * centers. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Graph { + /** + * Add the given [Node] to this graph. + * + * @param node The node to add. + */ + fun addNode(node: Node<*>) + + /** + * Add the given [Edge] to this graph. + * + * @param edge The edge to add. + */ + fun addEdge(edge: Edge<*>) +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt new file mode 100644 index 00000000..cce5990f --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/Node.kt @@ -0,0 +1,51 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology + +/** + * A node in the logical topology of a cloud network, representing some [Entity]. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface Node { + /** + * The [Entity] this node represents. + */ + val entity: E + + /** + * Return the set of incoming edges of this node. + * + * @return All edges whose destination is this node. + */ + fun incomingEdges(): Set> + + /** + * Return the set of outgoing edges of this node. + * + * @return All edges whose source is this node. + */ + fun outgoingEdges(): Set> +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/DataCenter.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/DataCenter.kt new file mode 100644 index 00000000..b72b0c2a --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/DataCenter.kt @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.container + +import nl.atlarge.opendc.topology.Entity + +/** + * A representation of a facility used to house computer systems and associated components. + * + * @param id The unique identifier of this entity. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +class DataCenter(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Rack.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Rack.kt new file mode 100644 index 00000000..d5ac5d99 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Rack.kt @@ -0,0 +1,36 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.container.rack + +import nl.atlarge.opendc.topology.Entity + +/** + * A type of physical steel and electronic framework that is designed to house servers, networking devices, cables and + * other data center computing equipment. + * + * @param id The unique identifier of this entity. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Rack(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Slot.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Slot.kt new file mode 100644 index 00000000..2556598e --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/rack/Slot.kt @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.container.rack + +/** + * This class represents a slot in a [Rack] of [Machine]s. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Slot(val index: Int) diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/room/Room.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/room/Room.kt new file mode 100644 index 00000000..e8dcfda5 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/container/room/Room.kt @@ -0,0 +1,35 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.container.room + +import nl.atlarge.opendc.topology.Entity + +/** + * A physical room in a data center which contains [Entity]s. + * + * @param id The unique identifier of this entity. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +abstract class Room(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Cpu.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Cpu.kt new file mode 100644 index 00000000..5c1b8b57 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Cpu.kt @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.machine + +/** + * A central processing unit. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Cpu( + override val id: Int, + override val speed: Int, + override val cores: Int, + override val energyConsumption: Int +): ProcessingUnit diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Gpu.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Gpu.kt new file mode 100644 index 00000000..91a7be6a --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Gpu.kt @@ -0,0 +1,37 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.machine + +/** + * A graphics processing unit. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Gpu( + override val id: Int, + override val speed: Int, + override val cores: Int, + override val energyConsumption: Int +): ProcessingUnit diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Machine.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Machine.kt new file mode 100644 index 00000000..8944362f --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/Machine.kt @@ -0,0 +1,36 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.machine + +import nl.atlarge.opendc.topology.Entity + +/** + * A Physical Machine (PM) inside a rack of a data center. It has a speed, and can be given a workload on which it will + * work until finished or interrupted. + * + * @param id The unique identifier of this entity. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class Machine(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/ProcessingUnit.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/ProcessingUnit.kt new file mode 100644 index 00000000..095a0bb5 --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/machine/ProcessingUnit.kt @@ -0,0 +1,49 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.machine + +import nl.atlarge.opendc.topology.Entity + +/** + * An interface representing a generic processing unit which is placed into a [Machine]. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface ProcessingUnit: Entity { + /** + * The speed of this [ProcessingUnit] per core. + */ + val speed: Int + + /** + * The amount of cores within this [ProcessingUnit]. + */ + val cores: Int + + /** + * The energy consumption of this [ProcessingUnit] in Kj/s. + */ + val energyConsumption: Int +} diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/network/NetworkUnit.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/network/NetworkUnit.kt new file mode 100644 index 00000000..fcb5f20a --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/network/NetworkUnit.kt @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.network + +import nl.atlarge.opendc.topology.Entity + +/** + * A generic interface for a network unit in a cloud network. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface NetworkUnit: Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/power/PowerUnit.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/power/PowerUnit.kt new file mode 100644 index 00000000..5fc0086d --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/power/PowerUnit.kt @@ -0,0 +1,36 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.power + +import nl.atlarge.opendc.topology.Entity + +/** + * An [Entity] which provides power for other entities a cloud network to run. + * + * @param id The unique identifier of the [Entity]. + * @param output The output of the power unit in Watts. + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +data class PowerUnit(override val id: Int, val output: Double): Entity diff --git a/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/storage/StorageUnit.kt b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/storage/StorageUnit.kt new file mode 100644 index 00000000..6fac585f --- /dev/null +++ b/opendc-core/src/main/kotlin/nl/atlarge/opendc/topology/storage/StorageUnit.kt @@ -0,0 +1,34 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package nl.atlarge.opendc.topology.storage + +import nl.atlarge.opendc.topology.Entity + +/** + * A generic interface for a storage unit in a cloud network. + * + * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) + */ +interface StorageUnit: Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Experiment.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Experiment.kt deleted file mode 100644 index c91f55da..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Experiment.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -/** - * A simulation of multiple simultaneous workloads running on top of a topology. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -class Experiment {} \ No newline at end of file diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/ExperimentRunner.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/ExperimentRunner.kt deleted file mode 100644 index 43b9ddac..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/ExperimentRunner.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -/** - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface ExperimentRunner { -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Job.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Job.kt deleted file mode 100644 index 8b225bd8..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Job.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -/** - * A job that is submitted to a cloud network, which consists of one or multiple [Task]s. - * - * @param owner The user to which the job belongs. - * @param tasks The tasks of which the job consists. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Job(val owner: User, val tasks: Collection) diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Scheduler.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Scheduler.kt deleted file mode 100644 index 4e000af3..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Scheduler.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -import nl.tudelft.opendc.topology.Entity -import nl.tudelft.opendc.topology.Node - -/** - * A task scheduler that is coupled to an [Entity] in the topology of the cloud network. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Scheduler { - /** - * Schedule the given jobs for the given entity. - * - * @param node The node in the cloud network topology representing the entity. - * @param jobs The jobs that have been submitted to the cloud network. - */ - fun schedule(node: Node, jobs: Set) -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Task.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Task.kt deleted file mode 100644 index f425ccac..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/Task.kt +++ /dev/null @@ -1,64 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -/** - * A task represents some computation that is part of a [Job]. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Task( - val id: Int, - val dependencies: Set, - val flops: Long -) { - /** - * The remaining amount of flops to compute. - */ - var remaining: Long = flops - private set - - /** - * A flag to indicate whether the task is finished. - */ - var finished: Boolean = false - private set - - /** - * Consume the given amount of flops of this task. - * - * @param flops The total amount of flops to consume. - */ - fun consume(flops: Long) { - if (finished) - return - if (remaining <= flops) { - finished = true - remaining = 0 - } else { - remaining -= flops - } - } -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/User.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/User.kt deleted file mode 100644 index a818fc5f..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/experiment/User.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.experiment - -import nl.tudelft.opendc.topology.Node - -/** - * A user of a cloud network that provides [Job]s for the simulation. - * - *

Each [User] in a simulation has its own logical view of the cloud network which is used to route its jobs in the - * physical network. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class User(val id: Int, val name: String, val view: Node<*>) {} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/sampler/Sampler.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/sampler/Sampler.kt deleted file mode 100644 index a89486ec..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/sampler/Sampler.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.sampler - -/** - * A sampler generates data points (samples) of the simulation based on the events that occur to [Entity] instances that - * are part of the simulation. - * - *

[Sampler]s work by observing [Entity] instances in the simulation and transforming this stream of events into a - * stream of data points. - * - *

An example would be a sampler that tracks [Machine] occupation per time unit, which is achieved by observing the - * [Entity]'s event stream and filtering for [JobAssignment] events. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Sampler diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/Simulator.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/Simulator.kt deleted file mode 100644 index c1ea6b2d..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/Simulator.kt +++ /dev/null @@ -1,68 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.simulator - -import nl.tudelft.opendc.topology.Entity - -/** - * A simulator that simulates a single entity in the topology of a cloud network. - * - * @param entity The entity to simulate. - * @param ctx The context in which the simulation is run. - * @param The type of entity to simulate. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -abstract class Simulator(val entity: E, val ctx: SimulatorContext) { - /** - * This method is invoked at least once before a tick. This allows the [Simulator] to setup its state before a tick - * event. - * - *

The pre-tick consists of multiple sub-cycles in which all messages which have been sent - * in the previous sub-cycle can optionally be processed in the sub-cycle by the receiving [Simulator]. - */ - fun preTick() {} - - /** - * This method is invoked once per tick, which allows the [Simulator] to process events and simulate an entity in a - * cloud network. - */ - fun tick() {} - - /** - * This method is invoked at least once per tick. This allows the [Simulator] to do work after a tick. - * - *

Like the pre-tick, the post-tick consists of multiple sub-cycles in which all messages which have been sent - * in the previous sub-cycle can optionally be processed in the sub-cycle by the receiving [Simulator]. - */ - fun postTick() {} - - /** - * Send the given message to the given [Entity] for processing. - * - * @param destination The entity to send the message to. - * @param message The message to send to the entity. - */ - fun send(destination: Entity, message: Any?) {} -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/SimulatorContext.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/SimulatorContext.kt deleted file mode 100644 index e7729bea..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/simulator/SimulatorContext.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.simulator - -/** - * The context in which a [Simulator] runs. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -class SimulatorContext { - /** - * The current tick of the simulation. - */ - var tick: Long = 0 -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Edge.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Edge.kt deleted file mode 100644 index 05541775..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Edge.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology - -/** - * An edge that represents a connection between exactly two instances of [Node]. - * Instances of [Edge] may be either directed or undirected. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Edge { - /** - * The label of this edge. - */ - val label: T - - /** - * An [Edge] that is directed, having a source and destination [Node]. - */ - interface Directed: Edge { - /** - * The source of the edge. - */ - val from: Node<*> - - /** - * The destination of the edge. - */ - val to: Node<*> - } - - /** - * An [Edge] that is undirected. - */ - interface Undirected: Edge - - /** - * Return the [Node] at the opposite end of this [Edge] from the - * specified node. - * - * Throws [IllegalArgumentException] if node is - * not incident to this edge. - * - * @param node The node to get the opposite of for this edge pair. - * @return The node at the opposite end of this edge from the specified node. - * @throws IllegalArgumentException if node is not incident to this edge. - */ - fun opposite(node: Node<*>): Node<*> - - /** - * Return a [Pair] representing this edge consisting of both incident nodes. - * Note that the pair is in no particular order. - * - * @return The edge represented as pair of both incident nodes. - */ - fun endpoints(): Pair, Node<*>> -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Entity.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Entity.kt deleted file mode 100644 index 37423959..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Entity.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology - -/** - * An entity in a cloud network. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Entity { - /** - * A unique identifier of this node within the topology represented as a [Int]. - */ - val id: Int -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Graph.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Graph.kt deleted file mode 100644 index 1cbbdb95..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Graph.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology - -/** - * A graph data structure which represents the logical topology of a cloud network consisting of one or more data - * centers. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Graph { - /** - * Add the given [Node] to this graph. - * - * @param node The node to add. - */ - fun addNode(node: Node<*>) - - /** - * Add the given [Edge] to this graph. - * - * @param edge The edge to add. - */ - fun addEdge(edge: Edge<*>) -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Node.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Node.kt deleted file mode 100644 index da0d183c..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/Node.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology - -/** - * A node in the logical topology of a cloud network, representing some [Entity]. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface Node { - /** - * The [Entity] this node represents. - */ - val entity: E - - /** - * Return the set of incoming edges of this node. - * - * @return All edges whose destination is this node. - */ - fun incomingEdges(): Set> - - /** - * Return the set of outgoing edges of this node. - * - * @return All edges whose source is this node. - */ - fun outgoingEdges(): Set> -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/DataCenter.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/DataCenter.kt deleted file mode 100644 index 56d0366e..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/DataCenter.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.container - -import nl.tudelft.opendc.topology.Entity - -/** - * A representation of a facility used to house computer systems and associated components. - * - * @param id The unique identifier of this entity. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -class DataCenter(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Rack.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Rack.kt deleted file mode 100644 index b64da3bb..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Rack.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.container.rack - -import nl.tudelft.opendc.topology.Entity - -/** - * A type of physical steel and electronic framework that is designed to house servers, networking devices, cables and - * other data center computing equipment. - * - * @param id The unique identifier of this entity. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Rack(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Slot.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Slot.kt deleted file mode 100644 index ce371e24..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/rack/Slot.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.container.rack - -/** - * This class represents a slot in a [Rack] of [Machine]s. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Slot(val index: Int) diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/room/Room.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/room/Room.kt deleted file mode 100644 index 0b73963d..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/container/room/Room.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.container.room - -import nl.tudelft.opendc.topology.Entity - -/** - * A physical room in a data center which contains [Entity]s. - * - * @param id The unique identifier of this entity. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -abstract class Room(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Cpu.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Cpu.kt deleted file mode 100644 index 612af5ce..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Cpu.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.machine - -/** - * A central processing unit. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Cpu( - override val id: Int, - override val speed: Int, - override val cores: Int, - override val energyConsumption: Int -): ProcessingUnit diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Gpu.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Gpu.kt deleted file mode 100644 index f4851f9c..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Gpu.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.machine - -/** - * A graphics processing unit. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Gpu( - override val id: Int, - override val speed: Int, - override val cores: Int, - override val energyConsumption: Int -): ProcessingUnit diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Machine.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Machine.kt deleted file mode 100644 index f50fc717..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/Machine.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.machine - -import nl.tudelft.opendc.topology.Entity - -/** - * A Physical Machine (PM) inside a rack of a data center. It has a speed, and can be given a workload on which it will - * work until finished or interrupted. - * - * @param id The unique identifier of this entity. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class Machine(override val id: Int): Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/ProcessingUnit.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/ProcessingUnit.kt deleted file mode 100644 index e7194a80..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/machine/ProcessingUnit.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.machine - -import nl.tudelft.opendc.topology.Entity - -/** - * An interface representing a generic processing unit which is placed into a [Machine]. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface ProcessingUnit: Entity { - /** - * The speed of this [ProcessingUnit] per core. - */ - val speed: Int - - /** - * The amount of cores within this [ProcessingUnit]. - */ - val cores: Int - - /** - * The energy consumption of this [ProcessingUnit] in Kj/s. - */ - val energyConsumption: Int -} diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/network/NetworkUnit.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/network/NetworkUnit.kt deleted file mode 100644 index c4a81d9b..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/network/NetworkUnit.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.network - -import nl.tudelft.opendc.topology.Entity - -/** - * A generic interface for a network unit in a cloud network. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface NetworkUnit: Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/power/PowerUnit.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/power/PowerUnit.kt deleted file mode 100644 index 19eeaea3..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/power/PowerUnit.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.power - -import nl.tudelft.opendc.topology.Entity - -/** - * An [Entity] which provides power for other entities a cloud network to run. - * - * @param id The unique identifier of the [Entity]. - * @param output The output of the power unit in Watts. - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -data class PowerUnit(override val id: Int, val output: Double): Entity diff --git a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/storage/StorageUnit.kt b/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/storage/StorageUnit.kt deleted file mode 100644 index d601e027..00000000 --- a/opendc-core/src/main/kotlin/nl/tudelft/opendc/topology/storage/StorageUnit.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2017 tudelft-atlarge - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package nl.tudelft.opendc.topology.storage - -import nl.tudelft.opendc.topology.Entity - -/** - * A generic interface for a storage unit in a cloud network. - * - * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) - */ -interface StorageUnit: Entity -- cgit v1.2.3