1 /* 2 * Copyright (C) 2018 Alberto Irurueta Carro (alberto@irurueta.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.irurueta.navigation.lateration; 17 18 import com.irurueta.geometry.Point; 19 20 /** 21 * Listener to be notified of events produced by a robust lateration solver when solving starts, ends or 22 * when progress changes. 23 * 24 * @param <P> a {@link Point} type. 25 */ 26 public interface RobustLaterationSolverListener<P extends Point<?>> { 27 28 /** 29 * Called when solving starts. 30 * 31 * @param solver solver raising the event. 32 */ 33 void onSolveStart(final RobustLaterationSolver<P> solver); 34 35 /** 36 * Called when solving ends. 37 * 38 * @param solver solver raising the event. 39 */ 40 void onSolveEnd(final RobustLaterationSolver<P> solver); 41 42 /** 43 * Called when solver iterates to refine a possible solution. 44 * 45 * @param solver solver raising the event. 46 * @param iteration current iteration. 47 */ 48 void onSolveNextIteration(final RobustLaterationSolver<P> solver, final int iteration); 49 50 /** 51 * Called when solving progress changes significantly. 52 * 53 * @param solver solver raising the event. 54 * @param progress progress of estimation expressed as a value between 0.0 and 1.0. 55 */ 56 void onSolveProgressChange(final RobustLaterationSolver<P> solver, final float progress); 57 }