/* * ===================================================================================== * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * ------------------------------------------------------------------------------------- * The primary purpose in distributing this source code is to enable * readers to reproduce the numerical results reported in our manuscript * on optimal control under constraints on reset-renewable resources. * See http://arxiv.org/abs/1110.6221 * * ------------------------------------------------------------------------------------- * Problem statement by R. Takei. * The idea of the algorithm by A. Vladimirsky. * The numerical method development by R. Takei & A. Vladimirsky. * Implementation by R. Takei. * * The method implemented in these files is not as general as the description * in the paper and relies on several implicit assumptions: * * 1) the dynamics is isotropic and the primary cost is identically = 1 on Omega; * 2) the secondary cost on U is identically = 1; * 3) the discretization parameters (h and deltaB) satisfy * a CFL-type condition: deltaB * f(x) \leq h. * * These assumptions are not essential for the approach, but simplify the implementation. * * To handle inhomogenious/anisotropic secondary costs and arbitrary deltaB/h ratios, * an alternative implementation was developed & tested by W. Chen, Z. Clawson, * and S. Kirov based on the code for the U=Omega case previously developed by A. Kumar. * This more general implementation is not included in the current distribution. * ===================================================================================== */ ReadMe.txt *** Running the Constrained Optimal Control script (used for "Optimal Control with Budget Constraints and Resets" by Takei, Chen, Clawson, Kirov and Vladimirsky) Instructions: 1. Open "BudgetResetOptimalControl.m" 2. Select parameters: a. "B" is the budget to be constrained. b. "N" is the number of grid points in each dimension. c. "test" accepts an integer value between 1 to 6 and is used to load pre-specified sample domains, speed functions and target coordinates, which were used in the journal. d. "plotOptimalPath" is set to 1 if an optimal path is to be computed (and plotted), and 0 otherwise. e. "X0" and "Y0" are the x and y coordinates of the initial position, if the optimal path is to be computed. 3. Execute the script. Note: if necessary, precompile the *.cpp files to generate the matlab mex files, by uncommenting lines 55 - 58: mex solveEikonal.cpp; mex solveConstrainedEikonal.cpp; mex solveOtherOptEikonal.cpp; mex computeVisibility.cpp;