Skip to content

'Diversity' computation should replace the pre-calculated weight_1_2 values #1

Description

@HeesukSon

In ModificationProbTree.java, Diversity computation is not reflected when assigning weight_1_2 values:

private void computeWeight_1_2(){
	Domain domain = ConfigUtil.getInstance().domain;

	if(domain == Domain.SDP){
		this.root.updateOutEdgeWeight(Functionality.PROTOCOL_BASIC_INFO.toString(), 0.577f);
		this.root.updateOutEdgeWeight(Functionality.CONTENT_PARSING.toString(), 0.451f);
		this.root.updateOutEdgeWeight(Functionality.PROTOCOL_BEHAVIOR.toString(), 0.662f);
		this.root.updateOutEdgeWeight(Functionality.SESSION_MGMT.toString(), 0.239f);
	}else{
		int cp_cnt = 0;
		int ss_cnt = 0;
		int prot_basic_info_cnt = 0;
		int prot_behav_cnt = 0;
		int sum = 0;

		for(MessageFieldUpdate update : kb.getUpdateHistory()){
			if(update.getFunc().equals(Functionality.CONTENT_PARSING)){
				cp_cnt++;
				sum++;
			}else if(update.getFunc().equals(Functionality.SESSION_MGMT)){
				ss_cnt++;
				sum++;
			}else if(update.getFunc().equals(Functionality.PROTOCOL_BASIC_INFO)){
				prot_basic_info_cnt++;
				sum++;
			}else if(update.getFunc().equals(Functionality.PROTOCOL_BEHAVIOR)){
				prot_behav_cnt++;
				sum++;
			}
		}

		this.root.updateOutEdgeWeight(Functionality.CONTENT_PARSING.toString(), (float)cp_cnt/sum);
		this.root.updateOutEdgeWeight(Functionality.PROTOCOL_BEHAVIOR.toString(), (float)ss_cnt/sum);
		this.root.updateOutEdgeWeight(Functionality.PROTOCOL_BASIC_INFO.toString(), (float)prot_basic_info_cnt/sum);
		this.root.updateOutEdgeWeight(Functionality.PROTOCOL_BEHAVIOR.toString(), (float)prot_behav_cnt/sum);
	}
}

This hardcoded weight value computation is written to save time for SDP case study experiment and should be replaced.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions