Пример #1
0
// Builds a new Computable
// queue: The Message Queue to be used by the worker
// id : the id of the computable
// points: The points to build the Estimator
// smooth: The smoothing parameter of the kernel estimator
func NewComputable(queue mpi.MessagesQueue, id int,
	est models.Estimate) *Computable {
	workerName := string(strconv.AppendInt([]byte("Worker "), int64(id), 10))
	ch := make(chan models.SLPoint)
	queue.Register(workerName)
	queue.Write(workerName, est.State())
	return &Computable{id, workerName, ch, est}
}