DogsBehaviorInComboLanguage (Embodiment)

From OpenCog
Jump to: navigation, search


THIS PAGE IS OBSOLETE

Dogs Behaviors in Combo Language

Expression Syntax

The embodiment combo dialect is described at EmbodimentCombo.

Spontaneous Behaviors in Combo Language

The following are based on the descriptions of PetBehaviors.


#Looking for food. If does not exist, ramdom_step_searching until find food
wander_searching_food(0) :=
	and_seq(
    	boolean_while(not(exists_edible) random_step_searching)
        goto_obj(nearest_edible) wag eat(nearest_edible)
    )


#Looking for water. If does not exist, ramdom_step_searching until find water
wander_searching_water(0) :=
    and_seq(
    	boolean_while(not(exists_drinkable) random_step_searching)
        and_seq(goto_obj(nearest_drinkable) wag drink(nearest_drinkable))
    )


#walk random, but more forward 
random_step_lib(0) := 
	and_seq( 
		action_boolean_if(0<(+(rand -0.5)) 
        	action_boolean_if(0<(+(rand -0.5))
          		rotate_left rotate_right
          	)
        	step_forward
      	)
		action_boolean_if(0<(+(rand -0.3))
	        step_forward
        	step_backward
        )
	)
	
#walk random, but more forward and more right and does not rotate every time
random_step_searching(0) := 
	and_seq(
    	action_boolean_if(0<(+(rand -0.5)) 
        	action_boolean_if(0<(+(rand -0.6))
          		rotate_left rotate_right
          	)
        	step_forward
        )
      	action_boolean_if(0<(+(rand -0.3))
        	step_forward
	        step_backward
	    )
	)

#pick  something, carry and drop after some number of random_step.
pick_carry_drop_chew_grab(0) :=
	action_boolean_if(0<(+(rand -0.666))
    	pick_carry_drop
    	action_boolean_if(0<(+(rand -0.5))
	    	pick_chew
     		pick_grab
      	)
    )

#pick  something, carry and drop after some number of random_step.
pick_carry_drop(0) :=
	and_seq(goto_obj(random_pickupable)
    	grab(nearest_pickupable)
    	wag
    	random_step_lib
    	random_step_lib
    	random_step_lib
    	boolean_while(0<(+(rand -0.5)) 
        	random_step_lib
        )
    	drop
    	wag
    )

#pick  something, carry and drop after some number of random_step.
pick_chew(0) :=
	and_seq(goto_obj(random_pickupable)
    	lick_at(nearest_pickupable)
    	lie_down
    	chew(nearest_pickupable)
    	wag
    	chew(nearest_pickupable)
    	wag
    	chew(nearest_pickupable)
    	wag
    	boolean_while(0<(+(rand -0.5)) 
      		and_seq(
        		chew(nearest_pickupable)
        		wag
        	)
        )
    	drop
    	wag
    )

#pick  something, carry and drop after some number of random_step.
pick_grabs_scratch(0) :=
	and_seq(goto_obj(random_pickupable)
    	grab(nearest_pickupable)
    	wag
    	scratch_other(nearest_pickupable)
    	wag
    	grab(nearest_pickupable)
    	shake_out
    	wag
    	boolean_while(0<(+(rand -0.5)) 
      		and_seq(
        		scratch_other(nearest_pickupable)
        		wag
        	)
        )
    	drop
    	wag
    )

#chase animals or people. follow obj (the parameter) for 15s. The object initially would be
#moving rapidly, but nowadays I can not know it.
chase_animal_people(1) :=
bool_if(or_seq(is_pet(#1) is_avatar(#1))
    and_seq(growlAt(#1) 
      bark folow(#1,15) 
      bark))



#Seek food locally, and whines if no food is around:
seek_food_whine(0) :=
    action_if(exists_edible
          and_seq(goto(random_edible)
                  eat(nearest_edible))
          whine)


-- Main.ElvysBorges - 17 Aug 2007 -- Main.MosheLooks - 26 Sep 2007