pcm-coordinator/api/internal/algo/task.go

32 lines
813 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package algo
type Task struct {
Tid int
Replicas int //副本数
Cpu float64
Mem float64
Disk float64
Time int //单个副本的运行时间
T0 int
T1 int
Pr float64 //延迟最低用户满意度为1时用户的支付价格
B int
MaxscoreStrategy *Strategy
ResourcePerTask [][]int //存储调度后每个云厂商的具体占用资源剩余执行时间
}
func NewTask(id int, replicas int, cpu float64, mem float64, disk float64, time int, t0 int, t1 int, Pr float64) *Task {
return &Task{
Tid: id,
Replicas: replicas,
Cpu: cpu,
Mem: mem,
Disk: disk,
Time: time,
T0: t0,
T1: t1,
Pr: Pr,
B: 5,
}
}