Commit 9bc6969e authored by wangdong's avatar wangdong

Add DDQN Slice

parent f309fd17
......@@ -174,7 +174,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.1.177";
mme_ip_address = ( { ipv4 = "192.168.1.12";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......
......@@ -176,7 +176,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = (
{
ipv4 = "192.168.1.177";
ipv4 = "192.168.1.12";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......
......@@ -1826,7 +1826,7 @@ set(L2_RRC_SRC
)
set(L2_LTE_SRC
${RLC_V1}
${RLC_V2}
)
set(L2_NR_SRC
......
......@@ -1076,7 +1076,6 @@ void apply_update_dl_slice_config(mid_t mod_id, Protocol__FlexSliceDlUlConfig *d
/* first update existing slices, then create new. Thus, we go through the
* list twice. First round, if a slice exists, handle and mark as such. Then,
* apply all others in the second round */
printf("Slice Numbers: %d\n", dl->n_slices);
LOG_I(FLEXRAN_AGENT, "Slice Numbers: %d\n", dl->n_slices);
if (dl->n_slices > 0) {
if (dl_algo == PROTOCOL__FLEX_SLICE_ALGORITHM__None) {
......
......@@ -66,6 +66,8 @@ enum flex_slice_algorithm {
Static = 1;
NVS = 2;
SCN19 = 3;
APEX = 4;
DDQN = 5;
}
......@@ -87,6 +89,22 @@ message flex_slice_scn19 {
optional uint32 typeid = 10;
}
message flex_slice_apex {
optional uint32 arb = 1;
optional uint32 mrb = 2;
optional uint32 typeid = 3;
optional float rbru = 4;
optional float nsrs = 5;
optional float reward = 6;
}
message flex_slice_ddqn {
optional uint32 arb = 1;
optional uint32 mrb = 2;
optional uint32 typeid = 3;
optional float thrpt = 4;
optional float delay = 5;
}
message flex_slice_static {
optional uint32 posLow = 1;
......@@ -108,6 +126,8 @@ message flex_slice {
flex_slice_static static = 10;
flex_slice_dynamic dynamic = 11;
flex_slice_scn19 scn19 =12;
flex_slice_apex apex = 13;
flex_slice_ddqn ddqn = 14;
}
}
......
......@@ -1402,7 +1402,7 @@ void flexran_set_pdcp_rx_stat_window(mid_t mod_id, uint16_t uid, uint16_t obs_wi
|| uid >= MAX_MOBILES_PER_ENB)
return;
Pdcp_stats_rx_window_ms[mod_id][uid] = obs_window > 0 ? obs_window : 1000;
Pdcp_stats_rx_window_ms[mod_id][uid] = obs_window > 0 ? obs_window : 1;
}
/*PDCP num tx pdu status flexRAN*/
......@@ -3022,6 +3022,10 @@ Protocol__FlexSliceAlgorithm flexran_get_dl_slice_algo(mid_t mod_id) {
return PROTOCOL__FLEX_SLICE_ALGORITHM__Static;
case SCN19_SLICING:
return PROTOCOL__FLEX_SLICE_ALGORITHM__SCN19;
case APEX_SLICING:
return PROTOCOL__FLEX_SLICE_ALGORITHM__APEX;
case DDQN_SLICING:
return PROTOCOL__FLEX_SLICE_ALGORITHM__DDQN;
default:
return PROTOCOL__FLEX_SLICE_ALGORITHM__None;
}
......@@ -3037,9 +3041,15 @@ int flexran_set_dl_slice_algo(mid_t mod_id, Protocol__FlexSliceAlgorithm algo) {
case PROTOCOL__FLEX_SLICE_ALGORITHM__Static:
mac->pre_processor_dl = static_dl_init(mod_id, cc_id);
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__APEX:
mac->pre_processor_dl = apex_dl_init(mod_id, cc_id);
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__SCN19:
mac->pre_processor_dl = static_dl_init(mod_id, cc_id);
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__DDQN:
mac->pre_processor_dl = ddqn_dl_init(mod_id, cc_id);
break;
default:
//如未指定slice算法,则回归原有的调度!
mac->pre_processor_dl.algorithm = 0;
......@@ -3138,6 +3148,25 @@ int flexran_create_dl_slice(mid_t mod_id, const Protocol__FlexSlice *s) {
((dynamic_slice_param_t *)params)->kpsRequired = s->dynamic->kpsrequired;
((dynamic_slice_param_t *)params)->kpsReference = s->dynamic->kpsreference;
break;
case PROTOCOL__FLEX_SLICE__PARAMS_APEX:
params = malloc(sizeof(apex_slice_param_t));
if (!params) return 0;
((apex_slice_param_t *)params)->arb = s->apex->arb;
((apex_slice_param_t *)params)->mrb = s->apex->mrb;
((apex_slice_param_t *)params)->rbru = s->apex->rbru;
((apex_slice_param_t *)params)->nsrs = s->apex->nsrs;
((apex_slice_param_t *)params)->typeid = s->apex->typeid_;
((apex_slice_param_t *)params)->reward = s->apex->reward;
break;
case PROTOCOL__FLEX_SLICE__PARAMS_DDQN:
params = malloc(sizeof(ddqn_slice_param_t));
if (!params) return 0;
((ddqn_slice_param_t *)params)->arb = s->ddqn->arb;
((ddqn_slice_param_t *)params)->mrb = s->ddqn->mrb;
((ddqn_slice_param_t *)params)->thrpt = s->ddqn->thrpt;
((ddqn_slice_param_t *)params)->typeid = s->ddqn->typeid_;
((ddqn_slice_param_t *)params)->delay = s->ddqn->delay;
break;
case PROTOCOL__FLEX_SLICE__PARAMS_SCN19:
params = malloc(sizeof(scn19_slice_param_t));
if (!params) return 0;
......@@ -3229,6 +3258,40 @@ void flexran_get_dl_slice(mid_t mod_id,
slice->static_->poshigh = ((static_slice_param_t *)s_->algo_data)->posHigh;
slice->params_case = PROTOCOL__FLEX_SLICE__PARAMS_STATIC;
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__APEX:
slice->apex = malloc(sizeof(Protocol__FlexSliceApex));
if (!slice->apex) return;
protocol__flex_slice_apex__init(slice->apex);
slice->apex->has_arb = 1;
slice->apex->arb = ((apex_slice_param_t *)s_->algo_data)->arb;
slice->apex->has_mrb = 1;
slice->apex->mrb = ((apex_slice_param_t *)s_->algo_data)->mrb;
slice->apex->has_typeid_ = 1;
slice->apex->typeid_ = ((apex_slice_param_t *)s_->algo_data)->typeid;
slice->apex->has_nsrs= 1;
slice->apex->nsrs = ((apex_slice_param_t *)s_->algo_data)->nsrs;
slice->apex->has_reward= 1;
slice->apex->reward = ((apex_slice_param_t *)s_->algo_data)->reward;
slice->apex->has_rbru= 1;
slice->apex->rbru = ((apex_slice_param_t *)s_->algo_data)->rbru;
slice->params_case = PROTOCOL__FLEX_SLICE__PARAMS_APEX;
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__DDQN:
slice->ddqn = malloc(sizeof(Protocol__FlexSliceDdqn));
if (!slice->ddqn) return;
protocol__flex_slice_ddqn__init(slice->ddqn);
slice->ddqn->has_arb = 1;
slice->ddqn->arb = ((ddqn_slice_param_t *)s_->algo_data)->arb;
slice->ddqn->has_mrb = 1;
slice->ddqn->mrb = ((ddqn_slice_param_t *)s_->algo_data)->mrb;
slice->ddqn->has_typeid_ = 1;
slice->ddqn->typeid_ = ((ddqn_slice_param_t *)s_->algo_data)->typeid;
slice->ddqn->has_thrpt= 1;
slice->ddqn->thrpt = ((ddqn_slice_param_t *)s_->algo_data)->thrpt;
slice->ddqn->has_delay= 1;
slice->ddqn->delay = ((ddqn_slice_param_t *)s_->algo_data)->delay;
slice->params_case = PROTOCOL__FLEX_SLICE__PARAMS_DDQN;
break;
case PROTOCOL__FLEX_SLICE_ALGORITHM__SCN19:
slice->scn19 = malloc(sizeof(Protocol__FlexSliceScn19));
if (!slice->scn19) return;
......
......@@ -663,6 +663,8 @@ typedef struct {
// total TBS with mcs2
// uint32_t total_TBS;
// total rb used for a new transmission
uint32_t last_total_rbs_used;
uint32_t last_tx_byte;
uint32_t total_rbs_used;
// total rb used for retransmission
uint32_t total_rbs_used_retx;
......
This diff is collapsed.
......@@ -62,8 +62,11 @@ int slicing_get_UE_slice_idx(slice_info_t *si, int UE_id);
#define STATIC_SLICING 10
#define SCN19_SLICING 11
#define APEX_SLICING 12
#define DDQN_SLICING 13
/* only four static slices for UL, DL resp. (not enough DCIs) */
#define MAX_STATIC_SLICES 10
#define MAX_APEX_SLICES 10
#define MAX_DYNAMIC_SLICES 10
#define RB_NUMS 25
#define BETA 0.1
......@@ -104,6 +107,27 @@ typedef struct {
float dloss;
} scn19_slice_param_t;
typedef struct {
uint16_t arb;
uint16_t mrb;
uint16_t typeid;
uint16_t rbs;
uint16_t tau;
float mpsrequire;
float delay;
float nsrs;
float rbru;
float weight;
float reward;
} apex_slice_param_t;
typedef struct {
uint16_t arb;
uint16_t mrb;
uint16_t typeid;
float thrpt;
float delay;
} ddqn_slice_param_t;
typedef struct {
uint16_t fexp;
......@@ -111,6 +135,8 @@ typedef struct {
uint16_t texp;
} stats_param_t;
pp_impl_param_t static_dl_init(module_id_t mod_id, int CC_id);
pp_impl_param_t apex_dl_init(module_id_t mod_id, int CC_id);
pp_impl_param_t ddqn_dl_init(module_id_t mod_id, int CC_id);
pp_impl_param_t static_ul_init(module_id_t mod_id, int CC_id);
// typedef struct {
......
#include "stdio.h"
#include "stdlib.h"
int main(){
int index1 = 5;
int index2 = 2;
printf("%f\n",(float)index1/(float)index2);
return 0;
}
\ No newline at end of file
......@@ -14,8 +14,8 @@
// now , if we use --mu option in UE, compiling error will occur.
// This problem will be fixed in the future.
# ifndef UESIM_EXPANSION
# define NUMBER_OF_UE_MAX 4
# define NUMBER_OF_NR_UE_MAX 4
# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_NR_UE_MAX 16
# define NUMBER_OF_UCI_VARS_MAX 14
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
......@@ -32,7 +32,7 @@
# define NUMBER_OF_CONNECTED_gNB_MAX 1
# endif
# else
# define NUMBER_OF_UE_MAX 1
# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_UCI_VARS_MAX 56
# define NUMBER_OF_CONNECTED_eNB_MAX 1
# define NUMBER_OF_CONNECTED_gNB_MAX 1
......@@ -77,7 +77,7 @@ and the other are using MAX_MOBILES_PER_ENB in for-loop.
# define NUMBER_OF_eNB_MAX 3
# define NUMBER_OF_gNB_MAX 3
# define NUMBER_OF_UE_MAX 3
# define NUMBER_OF_UE_MAX 16
# define NUMBER_OF_RU_MAX 3
# define NUMBER_OF_NR_RU_MAX 3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment