diff options
| author | ziejd2 | 2021-02-24 15:19:03 -0600 |
|---|---|---|
| committer | ziejd2 | 2021-02-24 15:19:03 -0600 |
| commit | 1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0 (patch) | |
| tree | d4356879a9b0a3d44063a6b292ef0197173697af /sourcecodes/modify_edges_processing.php | |
| parent | a2b306b10fb07f07c63235861ccfe460153e8609 (diff) | |
| download | BNW-1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0.tar.gz | |
Moving final GENENET8 version to master
Diffstat (limited to 'sourcecodes/modify_edges_processing.php')
| -rw-r--r-- | sourcecodes/modify_edges_processing.php | 234 |
1 files changed, 0 insertions, 234 deletions
diff --git a/sourcecodes/modify_edges_processing.php b/sourcecodes/modify_edges_processing.php deleted file mode 100644 index 98bf3f87..00000000 --- a/sourcecodes/modify_edges_processing.php +++ /dev/null @@ -1,234 +0,0 @@ -<?php -include("input_validate.php"); -$keyval=valid_keyval($_GET["My_key"]); - -function get_tier($keyval) -{ - -$tier=trim($_GET['tier']); -$dir="./data/"; -$tf=$dir.$keyval."del_var.txt"; -$fpvar = fopen("$tf","w"); - -fwrite($fpvar,"$tier"); -fclose($fpvar); -} - - -function enter_ban_list($t1,$s1,$t2,$s2,$tier_d,$fpvar) -{ - - for ($i=0;$i<$s1;$i++) - { - $data_val_1=$tier_d[$t1][$i]; - - for ($j=0;$j<$s2;$j++) - { - $data_val_2=$tier_d[$t2][$j]; - if($data_val_1!=$data_val_2) - { - - fprintf($fpvar,"%s\t%s\n",$data_val_1,$data_val_2); - - - } - - } - - } - - -} - - - -function describe_tier($fpvar,$keyval) -{ - - -$tierdesc=trim($_GET['tierdesc']); -$dir="./data/"; -$tf=$dir.$keyval."tier.txt"; -$tier=file_get_contents("$tf"); - -$tier_data=array(); -$tier_size=array(); -$tier_d=array(); -$tier_data=explode(",",$tier); - -$tn=$tier_data[0]; -$count=0; - -for ($i=0;$i<$tn;$i++) -{ - $count+=2; - $tier_size[$i]=$tier_data[$count]; - - $rs=$tier_size[$i]; - for ($j=0;$j<$rs;$j++) - { - $count++; - $tier_d[$i][$j]=$tier_data[$count]; - - - } - -} - - - -$data=array(); -$data=explode(",",$tierdesc); -$n=count($data); -$nn=0; -$di=0; -for ($i=0;$i<$tn;$i++) -{ - -$d_y=trim($data[$di]); -$di++; -$d_n=trim($data[$di]); - -if($d_n=="true") //put data in banlist -{ - $s1=$tier_size[$i]; - enter_ban_list($i,$s1,$i,$s1,$tier_d,$fpvar); - -} -$di++; - - - for ($j=0;$j<$tn;$j++) - { - if($j!=$i) - { - $p_d=trim($data[$di]); - $di++; - - if($p_d=="false") //put data in banlist - { - $s1=$tier_size[$j]; - $s2=$tier_size[$i]; - //echo $tier_size[$j]; - enter_ban_list($j,$s1,$i,$s2,$tier_d,$fpvar); - } - - - - $c_d=trim($data[$di]); - $di++; - if($c_d=="false") //put data in banlist - { - $s1=$tier_size[$i]; - $s2=$tier_size[$j]; - // echo $tier_size[$j]; - enter_ban_list($i,$s1,$j,$s2,$tier_d,$fpvar); - } - - - } - } - -} - - -} - - -function banlist($fpvar) -{ -$ban=trim($_GET['ban']); -$data=array(); -$data=explode(",",$ban); -$n=count($data); -$nn=0; -for ($i=0;$i<$n;$i+=2) -{ - $ii=$i+1; - $d1=trim($data[$i]); - $d2=trim($data[$ii]); - - if($d1!="" && $d2!="") - { - fprintf($fpvar,"%s\t%s\n",$d1,$d2); - $nn++; - } - -} - -} - -function whitelist($fpvar) -{ - -$white=trim($_GET['white']); - - - -$data=array(); -$data=explode(",",$white); -$n=count($data); -$nn=0; -for ($i=0;$i<$n;$i+=2){ -$ii=$i+1; -$d1=trim($data[$i]); -$d2=trim($data[$ii]); - -if($d1!="" && $d2!="") -{ - fprintf($fpvar,"%s\t%s\n",$d1,$d2); - $nn++; -} - -} - - -} - - -/////////////////////Call functions////////////////////// - - - -$dir="./data/"; - -$sid1=$dir.$keyval."del_edge"; -$sid2=$dir.$keyval."add_edge"; - -$Textban=$sid1.".txt"; -$Textwhite=$sid2.".txt"; -$fpb = fopen($Textban,"w"); -$fpw = fopen($Textwhite,"w"); -$datpost="From\tTo\n"; -fwrite($fpb,"$datpost"); -fwrite($fpw,"$datpost"); - -get_tier($keyval); - - -//describe_tier($fpb,$keyval); -banlist($fpb); -whitelist($fpw); - - -$oldkey=$keyval; - -///Generate new random key -$alphas=array(); -$alphas = array_merge(range('A', 'Z'), range('a', 'z')); - -$al1=rand(0,51); -$al2=rand(0,51); -$al3=rand(0,51); - -$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]"; -$keyval=$alpha; - -shell_exec('./run_scripts/run_mod_edges '.$oldkey.' '.$keyval); - - -////////////////////////////////////execute structurelearning///////////////////////////////////////////////////////////////////////////////////////////// -?> -<script> -window.open("graphviz_structure.php?My_key=<?php print($keyval);?>",'_self',false); -</script> \ No newline at end of file |
