How to use psh method in fMBT

Best Python code snippet using fMBT_python

ModelSetUp.py

Source:ModelSetUp.py Github

copy

Full Screen

...31 def add_var_e(self, var_name):32 return self.gur_model.addVars(self.e_system.parameter['EName'], ub=float('inf'),lb=-float('inf'), vtype="C", name=var_name)33 def add_var_I(self, var_name):34 return self.gur_model.addVars(self.e_system.parameter['EName'], vtype="B", name=var_name)35 def add_var_psh(self, var_name):36 return self.gur_model.addVars(self.psh_system.parameter['PSHName'], ub=float('inf'),lb=-float('inf'),vtype="C",name=var_name)37 def add_constraint_week_rolling(self):38 print(type(self.e_prev[0]))39 print(type(self.e_system.parameter['EStart']))40 print(type(self.e['Reservoir1']))41 for k in self.e_system.parameter['EName']:42 for i in range(self.one_day_period):43 if i == 0:44 LHS = self.e_prev[i][k] + grb.quicksum(self.psh_gen_prev[i][j] / self.psh_system.parameter['GenEfficiency'] for j in self.psh_system.parameter['PSHName']) \45 - grb.quicksum(self.psh_pump_prev[i][j] * self.psh_system.parameter['PumpEfficiency'] for j in self.psh_system.parameter['PSHName'])46 RHS = self.e_system.parameter['EStart']47 self.gur_model.addConstr(LHS == RHS, name='%s_%s' % ('SOC', i))48 else:49 LHS = self.e_prev[i][k] + grb.quicksum(self.psh_gen_prev[i][j] / self.psh_system.parameter['GenEfficiency'] for j in self.psh_system.parameter['PSHName']) \50 - grb.quicksum(self.psh_pump_prev[i][j] * self.psh_system.parameter['PumpEfficiency'] for j in self.psh_system.parameter['PSHName'])51 RHS = self.e_prev[i-1][k]52 self.gur_model.addConstr(LHS == RHS, name='%s_%s' % ('SOC', i))53 for k in self.e_system.parameter['EName']:54 LHS = self.e[k] + grb.quicksum(self.psh_gen[j] / self.psh_system.parameter['GenEfficiency'] for j in self.psh_system.parameter['PSHName']) \55 - grb.quicksum(self.psh_pump[j] * self.psh_system.parameter['PumpEfficiency'] for j in self.psh_system.parameter['PSHName'])56 RHS = self.e_prev[self.one_day_period-1][k]57 ### if we calculate the first one, we use 'SOC0', and the last we use 'End'; or we choose the SOC0 to "beginning", at the same time the last we use 'SOC'.58 self.gur_model.addConstr(LHS == RHS, name='%s_%s' % ('SOC0', k))59 def add_constraint_week_epsh(self):60 for j in self.psh_system.parameter['PSHName']: # all are lists61 self.gur_model.addConstr(self.psh_gen[j] <= self.psh_system.parameter['GenMax'], name='%s_%s' % ('psh_gen_max0', j))62 self.gur_model.addConstr(self.psh_gen[j] >= self.psh_system.parameter['GenMin'], name='%s_%s' % ('psh_gen_min0', j))63 self.gur_model.addConstr(self.psh_pump[j] <= self.psh_system.parameter['PumpMax'], name='%s_%s' % ('psh_pump_max0', j))64 self.gur_model.addConstr(self.psh_pump[j] >= self.psh_system.parameter['PumpMin'], name='%s_%s' % ('psh_pump_min0', j))65 for i in range(self.one_day_period):66 self.gur_model.addConstr(self.psh_gen_prev[i][j] <= self.psh_system.parameter['GenMax'], name='%s_%s' % ('psh_gen_max'+str(i),j))67 self.gur_model.addConstr(self.psh_gen_prev[i][j] >= self.psh_system.parameter['GenMin'], name='%s_%s' % ('psh_gen_min'+str(i),j))68 self.gur_model.addConstr(self.psh_pump_prev[i][j] <= self.psh_system.parameter['PumpMax'], name='%s_%s' % ('psh_pump_max'+str(i),j))69 self.gur_model.addConstr(self.psh_pump_prev[i][j] >= self.psh_system.parameter['PumpMin'], name='%s_%s' % ('psh_pump_min'+str(i),j))70 for k in self.e_system.parameter['EName']:71 self.gur_model.addConstr(self.e[k] <= self.e_system.parameter['EMax'], name='%s_%s' % ('e_max0', k))72 self.gur_model.addConstr(self.e[k] >= self.e_system.parameter['EMin'], name='%s_%s' % ('e_min0', k))73 for i in range(self.one_day_period):74 self.gur_model.addConstr(self.e_prev[i][k] <= self.e_system.parameter['EMax'], name='%s_%s' % ('e_max'+ str(i), k))75 self.gur_model.addConstr(self.e_prev[i][k] >= self.e_system.parameter['EMin'], name='%s_%s' % ('e_min0'+ str(i), k))76 def add_constraint_curve(self):77 for k in self.e_system.parameter['EName']:78 _temp_sum = 079 for i in range(self.curve.numbers):80 _temp_sum += self.soc[i][k]81 LHS = self.e[k]82 RHS = _temp_sum # RHS=soc[0][k]+soc[1][k]+soc[2][k]+soc[3][k]+soc[4][k]83 self.gur_model.addConstr(LHS == RHS, name='%s_%s' % ('curve', k))84 def add_constraint_soc(self):85 ### how to constraint for d_1I_2 <= soc_1 <=d_1I_1? ############################86 for k in self.e_system.parameter['EName']:87 for i in range(self.curve.numbers):88 name_num = str(i + 1)89 bench_num = i90 if bench_num == 0:91 self.gur_model.addConstr(self.soc[bench_num][k] <= float(self.d[bench_num]) * self.I[bench_num][k],92 name='%s_%s' % ('soc_' + name_num + '_max', k))93 self.gur_model.addConstr(float(self.d[bench_num]) * self.I[bench_num + 1][k] <= self.soc[bench_num][k],94 name='%s_%s' % ('soc_' + name_num + '_min', k))95 elif bench_num == self.curve.numbers - 1:96 self.gur_model.addConstr(self.soc[bench_num][k] <= float(self.d[bench_num]) * self.I[bench_num][k],97 name='%s_%s' % ('soc_' + name_num + '_max', k))98 self.gur_model.addConstr(0 <= self.soc[bench_num][k], name='%s_%s' % ('soc_' + name_num + '_min', k))99 else:100 self.gur_model.addConstr(self.soc[bench_num][k] <= float(self.d[bench_num]) * self.I[bench_num][k],101 name='%s_%s' % ('soc_' + name_num + '_max', k))102 self.gur_model.addConstr(float(self.d[bench_num]) * self.I[bench_num + 1][k] <= self.soc[bench_num][k],103 name='%s_%s' % ('soc_' + name_num + '_min', k))104 def add_constraint_I(self):105 for k in self.e_system.parameter['EName']:106 for i in range(self.curve.numbers - 1):107 name_num = str(i + 1)108 name_num_next = str(i + 2)109 bench_num = i110 self.gur_model.addConstr(self.I[bench_num + 1][k] <= self.I[bench_num][k],111 name='%s_%s' % ('I_' + name_num_next + '_' + name_num, k))112 def add_contraint_terminal(self):113 beta = 0.001 # 0.001114 for k in self.e_system.parameter['EName']:115 curr_day = self.curr_model_para.day_period - self.curr_model_para.curr_day116 LHS_1 = self.e[k] - self.e_system.parameter['EEnd']117 RHS_1 = (curr_day) * self.psh_system.parameter['GenMax'] / (118 self.psh_system.parameter['GenEfficiency'] + beta) # PSHmax_g[0] / PSHefficiency[0]119 self.gur_model.addConstr(LHS_1 <= RHS_1, name='%s_%s' % ('final_upper', k))120 for k in self.e_system.parameter['EName']:121 curr_day = self.curr_model_para.day_period - self.curr_model_para.curr_day122 LHS_2 = self.e[k] - self.e_system.parameter['EEnd']123 RHS_2 = -(curr_day) * self.psh_system.parameter['PumpMax'] * (124 self.psh_system.parameter['PumpEfficiency'] - beta) # PSHmax_p[0] * PSHefficiency[0]125 self.gur_model.addConstr(LHS_2 >= RHS_2, name='%s_%s' % ('final_lower', k))126 def add_week_contraint_terminal(self):127 for k in self.e_system.parameter['EName']:128 LHS = self.e[k] - self.e_system.parameter['EEnd']129 RHS = 0130 self.gur_model.addConstr(LHS == RHS, name='%s_%s' % ('final_up_down', k))131##the following is for set upt elements of optimization problems132 def set_up_week_variable(self):133 # add gen_prev, pump_prev, e_prev134 self.one_day_period = 23135 self.psh_gen_prev = []136 self.psh_pump_prev = []137 self.e_prev = []138 for i in range(self.one_day_period):139 name_num = str(i + 1)140 self.psh_gen_prev.append((self.add_var_psh('first_23_psh_gen_' + name_num)))141 self.psh_pump_prev.append((self.add_var_psh('first_23_psh_pump_' + name_num)))142 self.e_prev.append((self.add_var_e('first_23_e_' + name_num)))143 # add gen/pump144 self.psh_gen = self.add_var_psh('psh_gen_main')145 self.psh_pump = self.add_var_psh('psh_pump_main')146 #add e147 self.e = self.add_var_e('e_main')148 #add soc and I149 #self.len_var = self.curve.numbers #len(self.curve.point_X)-1150 self.soc = []151 self.I = []152 for i in range(self.curve.numbers):153 #for i in range(self.curve.numbers ):154 name_num = str(i + 1)155 self.soc.append(self.add_var_e('soc_' + name_num))156 self.I.append(self.add_var_I('I_' + name_num))157 #add d158 d = []159 for i in range(self.curve.numbers):160 #for i in range(self.curve.numbers ):161 d.append(self.curve.point_X[i+1] - self.curve.point_X[i])162 self.d = d163 self.gur_model.update()164 def set_up_constraint(self):165 # rolling constraint E_start = E_end +pump + gen166 self.add_constraint_week_rolling()167 # upper and lower constraint168 self.add_constraint_week_epsh()169 # curve constraint170 self.add_constraint_curve()171 # constraint for d_1I_2 <= soc_1 <=d_1I_1?##172 self.add_constraint_soc()173 # constraint for I_1<=I_2<=I_3174 self.add_constraint_I()175 # terminal constraint176 if self.curr_model_para.curr_day == 6:####6:177 self.add_week_contraint_terminal()178 self.gur_model.update()179 def set_up_week_object(self):180 self.profit_max = []181 for j in self.psh_system.parameter['PSHName']:182 self.profit_max.append((self.psh_gen[j] - self.psh_pump[j]) * self.lmp.lmp_scenarios)...

Full Screen

Full Screen

PerfectOpt.py

Source:PerfectOpt.py Github

copy

Full Screen

1import pandas as pd2from gurobipy import *3import gurobipy as grb4import matplotlib.pyplot as plt5import numpy as np6def Perfect_Opt(Total_hour, Input_folder,Output_folder,date, RT_DA ,probabilistic, time_total, scenario):7 print('################################## LAC_PSH_profit_max #', Total_hour, 'probabilistic=',probabilistic,' ##################################')8 ################################### Read Data ####################################9 ##read PSH10 filename = Input_folder + '/PSH.csv'11 Data = pd.read_csv(filename)12 df=pd.DataFrame(Data)13 PSHmin_g = df['GenMin']14 PSHmax_g = df['GenMax']15 PSHmin_p = df['PumpMin']16 PSHmax_p = df['PumpMax']17 PSHefficiency = list(df['Efficiency'])18 PSHname = list(df['Name'])19 ##read E20 filename = Input_folder + '/Reservoir.csv'21 Data = pd.read_csv(filename)22 df=pd.DataFrame(Data)23 Emin = df['Min']24 Emax = df['Max']25 Ename = df['Name']26 Edayend= float(df['End'])27 Estart = df['Start']28 ##read price29 filename = Input_folder + '/DECO_prd_dataframe_Perfect_October 1521 2019.csv'30 Data = pd.read_csv(filename)31 df = pd.DataFrame(Data)32 Column_name = list(Data.columns)33 Column_name = Column_name[scenario]34 lmp_quantiles = [1]35 lmp_scenarios = []36 Nlmp_s = 137 # the scenario you want38 lmp_scenarios.append(df[Column_name])39 lmp_scenarios = list(lmp_scenarios[0])40 e_time_periods = [] # 这个比总时间小141 for i in range(1, len(lmp_scenarios)):42 #for i in range(len(lmp_scenarios)):43 e_time_periods.append('T' + str(i))44 ################################### Build Model ####################################45 model = Model('DAMarket')46 ### define variables47 psh_max_g={}48 psh_min_g={}49 psh_max_p = {}50 psh_min_p = {}51 e_max={}52 e_min={}53 for i in e_time_periods:54 for k in PSHname:55 for s in range(Nlmp_s):56 psh_max_g[(s, i, k)] = list(PSHmax_g)[list(PSHname).index(k)]57 psh_min_g[(s, i, k)] = list(PSHmin_g)[list(PSHname).index(k)]58 psh_max_p[(s, i, k)] = list(PSHmax_p)[list(PSHname).index(k)]59 psh_min_p[(s, i, k)] = list(PSHmin_p)[list(PSHname).index(k)]60 for i in e_time_periods:61 for f in Ename:62 for s in range(Nlmp_s):63 e_max[(s, i, f)] = list(Emax)[list(Ename).index(f)]64 e_min[(s, i, f)] = list(Emin)[list(Ename).index(f)]65 e_max_inf = {}66 e_min_inf = {}67 psh_max_inf = {}68 psh_min_inf = {}69 for i in e_time_periods:70 for k in PSHname:71 for s in range(Nlmp_s):72 psh_max_inf[(s, i, k)] = float('inf')73 psh_min_inf[(s, i, k)] = -float('inf')74 for i in e_time_periods:75 for f in Ename:76 for s in range(Nlmp_s):77 e_max_inf[(s, i, f)] = float('inf')78 e_min_inf[(s, i, f)] = -float('inf')79 # psh0 and e0 are the first stage deterministic variables, while psh and e are stochastic variables.80 psh0_gen= model.addVars(list(PSHname), ub=float('inf'), lb=-float('inf'), name='PSH0_gen')81 psh0_pump= model.addVars(list(PSHname), ub=float('inf'), lb=-float('inf'), name='PSH0_pump')82 psh_gen = model.addVars(range(Nlmp_s), e_time_periods, list(PSHname), ub = psh_max_inf, lb = psh_min_inf, name = 'PSH_gen')83 psh_pump = model.addVars(range(Nlmp_s), e_time_periods, list(PSHname), ub = psh_max_inf, lb = psh_min_inf, name = 'PSH_pump')84 e0 = model.addVars(list(Ename), ub = float('inf'), lb = -float('inf'), name='E0')85 e = model.addVars(range(Nlmp_s), e_time_periods, list(Ename), ub=e_max_inf, lb=e_min_inf, name='E')86 model.update()87 ### add constraints88 # fix start state of energy stored in reservoir89 for j in Ename:90 print('Estart:', float(Estart))91 LHS = e0[j] + grb.quicksum(psh0_gen[j]/PSHefficiency[PSHname.index(j)] for j in PSHname)\92 - grb.quicksum(psh0_pump[j]*PSHefficiency[PSHname.index(j)] for j in PSHname) - float(Estart)93 RHS = 094 print(LHS, RHS)95 model.addConstr(LHS == RHS, name='%s_%s' % ('SOC0', j))96 # state of charge97 for i in e_time_periods:98 time_id = e_time_periods.index(i)99 if time_id == 0: #相当于除了e0的第一个,需要和e0交换100 for s in range(Nlmp_s):101 for j in Ename:102 print('Estart:',float(Estart))103 LHS = e[s, i, j] + grb.quicksum(psh_gen[s,i,j]/PSHefficiency[PSHname.index(j)] for j in PSHname)\104 - grb.quicksum(psh_pump[s, i, j] * PSHefficiency[PSHname.index(j)] for j in PSHname)- e0[j]105 RHS = 0106 print(LHS,RHS)107 model.addConstr(LHS == RHS, name='%s_%s_%d_%d' % ('SOC', j, time_id, s))108 # if time_id == len(e_time_periods) - 1:109 # for j in Ename:110 # print('Edayend:', Edayend)111 # LHS = Edayend - e[s, i, j]112 # RHS = 0113 # print(LHS,RHS)114 # model.addConstr(LHS == RHS, name='%s_%s_%d_%d' % ('SOC', j, len(e_time_periods),s))115 else:116 for s in range(Nlmp_s):117 time_previous=e_time_periods[time_id-1]118 for j in Ename:119 LHS=e[s,i,j] + grb.quicksum(psh_gen[s,i,j]/PSHefficiency[PSHname.index(j)] for j in PSHname)\120 - grb.quicksum(psh_pump[s,i,j]*PSHefficiency[PSHname.index(j)] for j in PSHname)-e[s,time_previous,j]121 RHS= 0122 print(LHS, RHS)123 model.addConstr(LHS == RHS, name='%s_%s_%d_%d' % ('SOC', j, time_id, s))124 if time_id == len(e_time_periods) - 1:125 for j in Ename:126 print('Edayend:', Edayend)127 LHS = Edayend - e[s, i, j]128 RHS = 0129 print(LHS,RHS)130 model.addConstr(LHS == RHS, name='%s_%s_%d_%d' % ('SOC', j, len(e_time_periods),s))131 # Upper and lower bounds132 for j in PSHname:133 model.addConstr(psh0_gen[j] <= PSHmax_g, name='%s_%s' % ('psh_gen_max0', j))134 model.addConstr(psh0_gen[j] >= PSHmin_g, name='%s_%s' % ('psh_gen_min0', j))135 model.addConstr(psh0_pump[j] <= PSHmax_p, name='%s_%s' % ('psh_pump_max0', j))136 model.addConstr(psh0_pump[j] >= PSHmin_p, name='%s_%s' % ('psh_pump_min0', j))137 for k in Ename:138 model.addConstr(e0[k] <= Emax, name='%s_%s' % ('e_max0', k))139 model.addConstr(e0[k] >= Emin, name='%s_%s' % ('e_min0', k))140 for s in range(Nlmp_s):141 for i in e_time_periods:142 for j in PSHname:143 model.addConstr(psh_gen[s, i, j] <= psh_max_g[s, i, j], name='%s_%s_%s_%s' % ('psh_gen_max',s, i, j))144 model.addConstr(psh_gen[s, i, j] >= psh_min_g[s, i, j], name='%s_%s_%s_%s' % ('psh_gen_min',s, i, j))145 model.addConstr(psh_pump[s, i, j] <= psh_max_p[s, i, j], name='%s_%s_%s_%s' % ('psh_pump_max', s, i, j))146 model.addConstr(psh_pump[s, i, j] >= psh_min_p[s, i, j], name='%s_%s_%s_%s' % ('psh_pump_min', s, i, j))147 for k in Ename:148 model.addConstr(e[s, i, k] <= e_max[s, i, k], name='%s_%s_%s_%s' % ('e_max',s, i, k))149 model.addConstr(e[s, i, k] >= e_min[s, i, k], name='%s_%s_%s_%s' % ('e_min',s, i, k))150 ### Objective function151 psh_max=[]152 for s in range(Nlmp_s):153 p_s = lmp_quantiles[s]154 for j in PSHname:155 psh_max.append((psh0_gen[j] - psh0_pump[j]) * lmp_scenarios[0] * p_s)156 for i in e_time_periods:157 lac_lmp = lmp_scenarios[e_time_periods.index(i)+1] #why这里加上1158 psh_max.append((psh_gen[s, i, j] - psh_pump[s, i, j]) * lac_lmp * p_s)159 obj = quicksum(psh_max)160 ################################### Solve Model ####################################161 model.setObjective(obj, GRB.MAXIMIZE)162 model.optimize()163 ####print the first result164 obj = model.getObjective() # self.calculate_pts(self.optimal_soc_sum)165 # self.optimal_profit = obj.getValue()166 print('the optimal profit is #####', obj.getValue())167 print('#####')168 # print results for variables169 for v in model.getVars():170 print("%s %f" % (v.Varname, v.X))171 ## add psh172 psh0=[]173 PSH0=[]174 for v in [v for v in model.getVars() if 'PSH0_gen' in v.Varname]:175 psh = v.X176 psh0.append(psh)177 for v in [v for v in model.getVars() if 'PSH0_pump' in v.Varname]:178 psh = v.X179 psh0.append(-psh)180 PSH0.append(sum(psh0))181 #if LAC_last_windows:182 psh_last_window_gen=[]183 psh_last_window_pump=[]184 PSH=[PSH0[0]]185 ## add soc186 SOC=[]187 for v in [v for v in model.getVars() if 'PSH_gen' in v.Varname]:188 psh = v.X189 psh_last_window_gen.append(psh)190 for v in [v for v in model.getVars() if 'PSH_pump' in v.Varname]:191 psh = v.X192 psh_last_window_pump.append(psh)193 for i in range(len(psh_last_window_gen)):194 PSH.append(psh_last_window_gen[i]-psh_last_window_pump[i])195 for v in [v for v in model.getVars() if 'E' in v.Varname]:196 soc = v.X197 SOC.append(soc)...

Full Screen

Full Screen

tcp_map.py

Source:tcp_map.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2# Copyright 2017, A10 Networks3# Author: Mike Thompson: @mike @t @a10@networks!com4# tcp reference for events, flags, states5_TCP_STATES = [6 'CLOSED',7 'LISTEN',8 'SYN_RCVD',9 'ESTABLISHED',10 'SYN_SENT',11 'FIN_WAIT_1',12 'FIN_WAIT_2',13 'TIME_WAIT',14 'CLOSING',15 'CLOSE_WAIT',16 'LAST_ACK',17]18TCP_EVENTS = [19 'PASSIVE',20 'ACTIVE',21 'SYN',22 'SYNACK',23 'ACK',24 'RDATA',25 'SDATA',26 'FIN',27 'CLOSE',28 'TIMEOUT',29]30_flag_map_hex = {31 0x00: 'NONE',32 0x01: 'FIN',33 0x02: 'SYN',34 0x03: 'FIN-SYN',35 0x04: 'RST',36 0x08: 'PSH',37 0x09: 'FIN-PSH',38 0x0A: 'SYN-PSH',39 0x0B: 'FIN-SYN-PSH',40 0x10: 'ACK',41 0x11: 'FIN-ACK',42 0x12: 'SYN-ACK',43 0x14: 'RST-ACK',44 0x13: 'FIN-SYN-ACK',45 0x18: 'PSH-ACK',46 0x19: 'FIN-PSH-ACK',47 0x1A: 'SYN-PSH-ACK',48 0x1B: 'FIN-SYN-PSH-ACK',49 0x1C: 'RST-PSH-ACK',50 0x20: 'URG',51 0x40: 'ECE',52 0x41: 'FIN-ECE',53 0x42: 'SYN-ECE',54 0x43: 'FIN-SYN-ECE',55 0x48: 'PSH-ECE',56 0x49: 'FIN-PSH-ECE',57 0x4A: 'SYN-PSH-ECE',58 0x4B: 'FIN-SYN-PSH-ECE',59 0x50: 'ACK-ECE',60 0x51: 'FIN-ACK-ECE',61 0x52: 'SYN-ACK-ECE',62 0x53: 'FIN-SYN-ACK-ECE',63 0x58: 'PSH-ACK-ECE',64 0x59: 'FIN-PSH-ACK-ECE',65 0x5A: 'SYN-PSH-ACK-ECE',66 0x5B: 'FIN-SYN-PSH-ACK-ECE',67 0x80: 'CWR',68 0x81: 'FIN-CWR',69 0x82: 'SYN-CWR',70 0x83: 'FIN-SYN-CWR',71 0x88: 'PSH-CWR',72 0x89: 'FIN-PSH-CWR',73 0x8A: 'SYN-PSH-CWR',74 0x8B: 'FIN-SYN-PSH-CWR',75 0x90: 'ACK-CWR',76 0x91: 'FIN-ACK-CWR',77 0x92: 'SYN-ACK-CWR',78 0x93: 'FIN-SYN-ACK-CWR',79 0x98: 'PSH-ACK-CWR',80 0x99: 'FIN-PSH-ACK-CWR',81 0x9A: 'SYN-PSH-ACK-CWR',82 0x9B: 'FIN-SYN-PSH-ACK-CWR',83 0xC0: 'ECE-CWR',84 0xC1: 'FIN-ECE-CWR',85 0xC2: 'SYN-ECE-CWR',86 0xC3: 'FIN-SYN-ECE-CWR',87 0xC8: 'PSH-ECE-CWR',88 0xC9: 'FIN-PSH-ECE-CWR',89 0xCA: 'SYN-PSH-ECE-CWR',90 0xCB: 'FIN-SYN-PSH-ECE-CWR',91 0xD0: 'ACK-ECE-CWR',92 0xD1: 'FIN-ACK-ECE-CWR',93 0xD2: 'SYN-ACK-ECE-CWR',94 0xD3: 'FIN-SYN-ACK-ECE-CWR',95 0xD8: 'PSH-ACK-ECE-CWR',96 0xD9: 'FIN-PSH-ACK-ECE-CWR',97 0xDA: 'SYN-PSH-ACK-ECE-CWR',98 0xDB: 'FIN-SYN-PSH-ACK-ECE-CWR'99}100# tcp_flag_map_dec = {101#102# }103# from collections import OrderedDict104#105# sorted_dictionary = OrderedDict(sorted(_flag_map_hex.items(), key=lambda v: v, reverse=False))106# print '{'107# for k,v in sorted_dictionary.items():108# print str(k) +':"'+v+'"'...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful