J_History_Fa Documentation

This page contains the J_History_Fa Package documentation.

The history_fa Module

Module for pattern match: History based Finite Automaton algorithm.

class netbench.pattern_match.algorithms.j_history_fa.history_fa.history_fa

Bases: netbench.pattern_match.b_dfa.b_dfa

Class for History based Finite Automaton.

compute(file_name)

Fuction for make History based FA from RE in file_name.

Parameter:file_name (string) – Name of input file
report_memory_naive()

Report consumed memory in bytes. Naive mapping algorithm is used (2D array). Basic algorithm for this variant of mapping is: M = |states| * |alphabet| * ceil(log(|states| + 1, 2) / 8) For History is: basic + Mem(Flags) + (State * Sym * Flags * 2)

Returns:Returns number of bytes.
Return type:int
report_memory_optimal()

Report consumed memory in bytes. Optimal mapping algorithm is used (with oracle). Basic algorithm for this variant of mapping is: M = |transitions| * ceil(log(|states|, 2) / 8). For History is: basic + Mem(Flags) + (Tran*Flags*2).

Returns:Returns number of bytes.
Return type:int
save_to_file(file_name)

Make file which represent the History automat. This file will be input into algorithm written in C language.

Parameter:file_name (string) – Name of output file

The test_history_fa Module

class netbench.pattern_match.algorithms.j_history_fa.test_history_fa.test_history_fa(methodName='runTest')

Bases: unittest.TestCase

Test module for History FA.

test_compute()
compute()
test_report_memory_naive()
report_memory_naive()
test_report_memory_optimal()
report_memory_optimal()
test_save_to_file()
save_to_file()

Table Of Contents

Previous topic

Delay_Dfa Documentation

This Page