8
/* This routine prints the data to disk and to stdout, since the new result
9
is better than all previous */
11
void do_since_better(int i, char *output_filename, char *update_filename, struct FCOMPLEX input_impedance, struct performance_data n,struct flags flag,char * notes,double frequency,double min_frequency,double max_frequency,double step_frequency,int elements, int driven,int parasitic,double angular_step,double **driven_data,double **parasitic_data,double scale_factor,double new_perf)
13
static int run_first_time=TRUE;
15
FILE *fp_out, *update_fp;
17
n.r=input_impedance.r; n.x=input_impedance.i;
18
if(flag.Wflg || flag.gflg)
22
print_relavent_performance_data(stdout,"",i,flag,n,new_perf,TRUE,print_fitnessQ);
23
update_fp=fopen(update_filename,"a");
24
if(run_first_time==TRUE && flag.wflg)
25
fprintf(update_fp, "Optimised for wide-band use\n");
26
if(run_first_time==TRUE && flag.gflg)
27
fprintf(update_fp, "Optimised With the genetic algoritm\n");
30
print_relavent_performance_data(update_fp,"",i,flag,n,new_perf,TRUE,print_fitnessQ);
32
/* write our best design to date to disk */
34
fp_out=fopen(output_filename,"wt");
35
write_input_data_to_disk(fp_out, notes, frequency/1e6, min_frequency/1e6,max_frequency/1e6, step_frequency/1e6, elements, driven, parasitic, angular_step,driven_data, parasitic_data, scale_factor);
41
fprintf(stderr,"Errno =%d in dobetter.c\n", errno);