'''
Created on 3.10.2012

@author: Teemu Pkknen
'''

def get_callback_map():

  AVG_AUTOCOMPLETE_INPUT_LENGTH = 5

  def get_current_query_cost( simulation, key_cost, interaction_type ):
    if "basic" == interaction_type:
      return float(key_cost) * len( simulation.get_current_query_text() )
    elif "autocomplete" == interaction_type:
      return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH

  return { 'get_default_current_query_cost': get_current_query_cost }

'''
Created on 3.10.2012

@author: Teemu Pkknen
'''

def get_callback_map():

  AVG_AUTOCOMPLETE_INPUT_LENGTH = 5

  def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
    if "basic" == interaction_type:
      return float(key_cost) * len( simulation.get_current_query_text() )
    elif "autocomplete" == interaction_type:
      return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH

  return { 'get_default_current_query_cost': get_current_query_cost }

Change default query cost calculation interaction type to "basic"
Change default query cost calculation interaction type to "basic"

  '''
  Created on 3.10.2012
  
  @author: Teemu Pkknen
  '''
  
  def get_callback_map():
  
    AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
  
-   def get_current_query_cost( simulation, key_cost, interaction_type ):
+   def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
      if "basic" == interaction_type:
        return float(key_cost) * len( simulation.get_current_query_text() )
      elif "autocomplete" == interaction_type:
        return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
  
    return { 'get_default_current_query_cost': get_current_query_cost }
  
Change default query cost calculation interaction type to "basic"
## Code Before:
'''
Created on 3.10.2012

@author: Teemu Pkknen
'''

def get_callback_map():

  AVG_AUTOCOMPLETE_INPUT_LENGTH = 5

  def get_current_query_cost( simulation, key_cost, interaction_type ):
    if "basic" == interaction_type:
      return float(key_cost) * len( simulation.get_current_query_text() )
    elif "autocomplete" == interaction_type:
      return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH

  return { 'get_default_current_query_cost': get_current_query_cost }

## Instruction:
Change default query cost calculation interaction type to "basic"
## Code After:
'''
Created on 3.10.2012

@author: Teemu Pkknen
'''

def get_callback_map():

  AVG_AUTOCOMPLETE_INPUT_LENGTH = 5

  def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
    if "basic" == interaction_type:
      return float(key_cost) * len( simulation.get_current_query_text() )
    elif "autocomplete" == interaction_type:
      return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH

  return { 'get_default_current_query_cost': get_current_query_cost }
