docstr: Linearly decreasing/increasing between :math:`w_{start}` and :math:`w_{end}`
  
  Defaults: :math:`w^{end} = 0.4, c^{end}_{1} = 0.8 * c^{start}_{1}, c^{end}_{2} = c^{start}_{2}`
  
  .. math::
          w = w^{end}+(w^{start}-w^{end}) \frac{iter^{max}-iter}{iter^{max}}
  
  Ref: Xin, Jianbin, Guimin Chen, and Yubao Hai. "A particle swarm optimizer with 
  multi-stage linearly-decreasing inertia weight." 2009 International joint conference 
  on computational sciences and optimization. Vol. 1. IEEE, 2009.
docstr_tok: ["Linearly","decreasing\/increasing","between",":","math",":","`","w_","{","start","}","`","and",":","math",":","`","w_","{","end","}","`","Defaults",":",":","math",":","`","w^","{","end","}","=","0.4",",","c^","{","end","}","_","{","1","}","=","0.8","*","c^","{","start","}","_","{","1","}",",","c^","{","end","}","_","{","2","}","=","c^","{","start","}","_","{","2","}","`","..","math",":",":","w","=","w^","{","end","}","+","(","w^","{","start","}","-w^","{","end","}",")","\\frac","{","iter^","{","max","}","-iter","}","{","iter^","{","max","}","}","Ref",":","Xin",",","Jianbin",",","Guimin","Chen",",","and","Yubao","Hai",".","``","A","particle","swarm","optimizer","with","multi-stage","linearly-decreasing","inertia","weight",".","''","2009","International","joint","conference","on","computational","sciences","and","optimization",".","Vol",".","1",".","IEEE",",","2009","."]
code: def lin_variation(self, start_opts, opt, **kwargs):
      """
      Linearly decreasing/increasing between :math:`w_{start}` and :math:`w_{end}`
  
      Defaults: :math:`w^{end} = 0.4, c^{end}_{1} = 0.8 * c^{start}_{1}, c^{end}_{2} = c^{start}_{2}`
  
      .. math::
              w = w^{end}+(w^{start}-w^{end}) \\frac{iter^{max}-iter}{iter^{max}}
  
      Ref: Xin, Jianbin, Guimin Chen, and Yubao Hai. "A particle swarm optimizer with
      multi-stage linearly-decreasing inertia weight." 2009 International joint conference
      on computational sciences and optimization. Vol. 1. IEEE, 2009.
      """
  
      try:
          end_opts = {
              "w": 0.4,
              "c1": 0.8 * start_opts["c1"],
              "c2": 1 * start_opts["c2"],
          }
          if "end_opts" in kwargs:
              if opt in kwargs["end_opts"]:
                  end_opts[opt] = kwargs["end_opts"][opt]
          start = start_opts[opt]
          end = end_opts[opt]
          new_val = (
              end
              + (start - end)
              * (kwargs["itermax"] - kwargs["iternow"])
              / kwargs["itermax"]
          )
      except KeyError:
          self.rep.logger.exception(
              "Keyword 'itermax' or 'iternow' missing"
          )
          raise
      else:
          return new_val
  
imports: import inspect
  import logging
  import numpy
  import math
  from copy import copy
  from ..utils.reporter import Reporter
label_desc: Use image node_id 4 for calling the OptionsHandler obj's underlying member method code with example usage: obj.lin_variation(start_opts, opt) and returns: new_val