From 29f10e82fcff18e60bdb42cc824b2e18a40887bf Mon Sep 17 00:00:00 2001 From: Matt Argao Date: Tue, 23 Oct 2012 15:40:28 -0400 Subject: Improved optimization Removes repeating optic sets Stores possible solutions Returns waist from fitness function Solutions with same significant digits are truncated Visualize possible solutions Outputs solutions with a fitness threshold --- fitness.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fitness.m') diff --git a/fitness.m b/fitness.m index 80835e5..c92d734 100644 --- a/fitness.m +++ b/fitness.m @@ -1,9 +1,10 @@ -function Energy = fitness( q_0, q_final, x_final, optics_positions, optics_focal_length ) +function [Energy, Waist] = fitness( q_0, q_final, x_final, optics_positions, optics_focal_length, lambda ) %FITNESS Summary of this function goes here % Detailed explanation goes here x0 = 0; q_f_trial = gbeam_propagation(x_final,q_0,x0,optics_placer(optics_positions, optics_focal_length)); - + [Waist, Radius] = q2wr(q_f_trial, lambda); + Energy = abs(q_final-q_f_trial); % penalty calculation -- cgit v1.2.3