An optimization-based algorithm for indoor localization of JADE agents