I am new to scala and I apologize in advance if the question is stupid. I am browsing through this scala code and I am confused how the following code works
abstract class ClusterSimulatorDesc(val runTime: Double) {
def newSimulator(constantThinkTim: Double,
perTaskThinkTime: Double,
blackListPercent: Double,
schedulerWorkloadsToSweepOver: Map[String, Seq[String]],
workloadToSchedulerMap: Map[String, Seq[String]],
cellStateDesc: CellStateDesc,
workloads: Seq[Workload],
prefillWorkloads: Seq[Workload],
logging: Boolean = false): ClusterSimulator
}
class ClusterSimulator(val cellState: CellState,
val schedulers: Map[String, Scheduler],
val workloadToSchedulerMap: Map[String, Seq[String]],
val workloads: Seq[Workload],
prefillWorkloads: Seq[Workload],
logging: Boolean = false,
monitorUtilization: Boolean = true,
monitoringPeriod: Double = 1.0)
extends Simulator(logging) {
Now if i have a function call like:-
simulatorDesc: ClusterSimulatorDesc
val simulator =
simulatorDesc.newSimulator(constantThinkTime,
perTaskThinkTime,
blackListPercent,
schedulerWorkloadsToSweepOver,
schedulerWorkloadMap,
workloadDesc.cellStateDesc,
workloads,
prefillWorkloads,
logging)
Now the question I have is, what does "ClusterSimulator" at the end of the abstract class declaration does? And, how does the calling of "newSimulator" function happen, considering that its declared in an abstract class?