2 // ========================LICENSE_START=================================
5 // Copyright (C) 2022: Nordix Foundation
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 // ========================LICENSE_END===================================
23 import "oransc.org/usecase/oduclosedloop/icsversion/messages"
25 type SliceMetric struct {
30 RRMPolicyRatioId string
34 func NewSliceMetric(duid string, cellid string, sd int, sst int) *SliceMetric {
39 SliceServiceType: sst,
41 sm.PM = make(map[string]int)
45 type PolicyRatio struct {
49 PolicyDedicatedRatio int
52 func NewPolicyRatio(id string, max_ratio int, min_ratio int, ded_ratio int) *PolicyRatio {
55 PolicyMaxRatio: max_ratio,
56 PolicyMinRatio: min_ratio,
57 PolicyDedicatedRatio: ded_ratio,
62 func (pr *PolicyRatio) GetUpdateDedicatedRatioMessage(sd int, sst int, dedicatedRatio int) interface{} {
63 message := messages.RRMPolicyRatio{
66 UserLabel: pr.PolicyRatioId,
67 RRMPolicyMaxRatio: pr.PolicyMaxRatio,
68 RRMPolicyMinRatio: pr.PolicyMinRatio,
69 RRMPolicyDedicatedRatio: dedicatedRatio,
71 RRMPolicyMembers: []messages.RRMPolicyMember{
73 MobileCountryCode: "046",
74 MobileNetworkCode: "651",
75 SliceDifferentiator: sd,
76 SliceServiceType: sst,
80 rrmPolicies := []messages.RRMPolicyRatio{message}
83 RRMPolicies []messages.RRMPolicyRatio `json:"radio-resource-management-policy-ratio"`
85 RRMPolicies: rrmPolicies,