title: Simple 1D Continuous Space Hill Climbing Algorithm
body: <p>I am searching for a simple hill climbing Algorithm</p>
  
  <p>It is for a large scale simulation, 
  This is an example of how the "CurrentLocation" is changing.</p>
  
  <pre><code>import time
  targ = 1.5  # target of t
  location = 1   #starting point
  step = 0.9  # step change starting point
  a=0
  b=0
  while abs(targ-location)&gt;0.05:
      if targ&gt;location:
          if b==1: # If I already been at b
              b=0
              a=0
              step = step*(0.9)
              print 'stepChangeA'
              location =location +  abs(location*step)
          else:
              location =location +  abs(location*step)
              a=1
              print 'increase'
      else:
          if a==1:  #If I already been at a
              a=0
              b=0
              step = step*(0.9)
              print 'stepChangeB'
              location =location -  abs(location*step)
          else:
              location = location - abs(location*step)
              b=1
              print 'decrease'
      time.sleep(0.1)  # just so it will be easy to see the change.. 
      print location 
  </code></pre>
  
  <p>The algorithm that I presented is working, But I feel that there most be something more effective...
  any advise ? </p>
  
  <p>Thank You</p>