pcm-coordinator/pkg/scheduler/algorithm/providerPricing/task.go

46 lines
1.3 KiB
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.

/*
Copyright (c) [2023] [pcm]
[pcm-coordinator] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
package providerPricing
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,
}
}