From a89dc9b6d1499bd446a5d36dd2252c98548e6a45 Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Thu, 8 Nov 2012 16:37:21 -0500 Subject: Changed # of shuffles & penalty weight --- fitness.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fitness.m') diff --git a/fitness.m b/fitness.m index 00cbada..3516ac7 100644 --- a/fitness.m +++ b/fitness.m @@ -8,13 +8,11 @@ function [Energy, Waist, Penalty] = fitness( q_0, q_final, x_final, optics_posit [Waist_trial_forward, Radius_trial_forward] = q2wr(q_f_trial_forward, lambda); q_f_trial_backward = gbeam_propagation(x,q_final,x_final,optics_placer(optics_positions, optics_focal_length)); [Waist_trial_backward, Radius_trial_backward] = q2wr(q_f_trial_backward, lambda); - + Energy = 0; Penalty_waist_mismatch = sum(abs((Waist_trial_forward-Waist_trial_backward)./min(Waist_trial_forward, Waist_trial_backward)))/Np; - Penalty_waist_mismatch = 0*Penalty_waist_mismatch + 1e9*sum(abs((Waist_trial_forward-Waist_trial_backward)))/Np; - Penalty_radius_mismatch = sum(abs((Radius_trial_forward-Radius_trial_backward)./max(Radius_trial_forward, Radius_trial_backward)))/Np; - - Energy = 0*Penalty_radius_mismatch + Penalty_waist_mismatch; + Penalty_waist_mismatch + Energy = 1e-2*Penalty_waist_mismatch; % penalty calculation % do not put lenses too close to each other and end positions -- cgit v1.2.3