next up previous contents
Next: Index of experiment materials Up: Description and usage guide Previous: Input file format   Contents


Example input file

This section gives the input file used in example 1 of chapter 4.

/****************************************/
/* experiment configuration		*/
/****************************************/

/* use sampling? */
/* sampling(on,50,50). */
/* sampling(off,10,1000). */



/***********************************/
/* belief model for the blue agent */
/***********************************/


belief_model(blue_agent,[ A,
                          nesting_level(2,B),
                          nesting_level(3,C),
                          nesting_level(4,B),
                          nesting_level(5,C),
                          nesting_level(6,B),
                          nesting_level(7,C),
                          nesting_level(8,B),
                          nesting_level(9,C),
                          nesting_level(10,B),
                          nesting_level(11,C)
                        ]) :-

belief_model(blue_agent_basis,
             [A,
	      nesting_level(2,B),
	      nesting_level(3,C)
	     ]
).


belief_model(
	blue_agent_basis,
	[
		nesting_level(
			1,
			[
				p(decomp(fix-car,
				  [ask-car-spanner,lend-car-spanner,
				    use-car-spanner]),1),
				p(decomp(ask-car-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(decomp(fix-bike,
				  [ask-bike-spanner,lend-bike-spanner,
			            use-bike-spanner]),1),
				p(decomp(ask-bike-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-bike-spanner,[ask-bike-unambiguous]),1),

				p(intend(fix-car,
				  [ask-car-spanner]),1),
				p(intend(ask-car-spanner,
				  [ask-ambiguous]),1),
				p(intend(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(intend(fix-bike,
				  [ask-bike-spanner]),1),
				p(intend(ask-bike-spanner,
				  [ask-ambiguous]),0),
				p(intend(ask-bike-spanner,
				  [ask-bike-unambiguous]),1)
			]
		),
		nesting_level(
			2,
			[
				p(decomp(fix-car,
				  [ask-car-spanner,lend-car-spanner,
				    use-car-spanner]),1),
				p(decomp(ask-car-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(decomp(fix-bike,
				  [ask-bike-spanner,lend-bike-spanner,
				    use-bike-spanner]),1),
				p(decomp(ask-bike-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-bike-spanner,
				  [ask-bike-unambiguous]),1),

				p(intend(fix-car,
				  [ask-car-spanner]),1),
				p(intend(ask-car-spanner,
				  [ask-ambiguous]),0.5),
				p(intend(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(intend(fix-bike,
				  [ask-bike-spanner]),1),
				p(intend(ask-bike-spanner,
				  [ask-ambiguous]),0.5),
				p(intend(ask-bike-spanner,
				  [ask-bike-unambiguous]),1)
			]
		),
		nesting_level(
			3,
			[
				p(decomp(fix-car,
				  [ask-car-spanner,lend-car-spanner,
				    use-car-spanner]),1),
				p(decomp(ask-car-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(decomp(fix-bike,
				  [ask-bike-spanner,lend-bike-spanner,
				    use-bike-spanner]),1),
				p(decomp(ask-bike-spanner,
				  [ask-ambiguous]),1),
				p(decomp(ask-bike-spanner,
				  [ask-bike-unambiguous]),1),

				p(intend(fix-car,
				  [ask-car-spanner]),1),
				p(intend(ask-car-spanner,
				  [ask-ambiguous]),0.5),
				p(intend(ask-car-spanner,
				  [ask-car-unambiguous]),1),

				p(intend(fix-bike,
				  [ask-bike-spanner]),1),
				p(intend(ask-bike-spanner,
				  [ask-ambiguous]),0.5),
				p(intend(ask-bike-spanner,
				  [ask-bike-unambiguous]),1)
			]
		)
	]
).



/************************************************/
/* cost model					*/
/************************************************/


/* nb all atoms have to have a utility */
utility(ask-ambiguous,-5).
utility(ask-car-unambiguous,-10).
utility(ask-bike-unambiguous,-10).
utility(lend-car-spanner,-10).
utility(lend-bike-spanner,-10).
utility(ask-clar,-3).
utility(answer-bike,-1).
utility(answer-car,-1).

utility(use-car-spanner,0).
utility(use-bike-spanner,0).


reward(Plan,100) :-
  plan_contains(Plan,fix-car),
  plan_contains(Plan,use-car-spanner), !.

reward(Plan,100) :-
  plan_contains(Plan,fix-bike),
  plan_contains(Plan,use-bike-spanner), !.

reward(Plan,80).



seed([alternative(plan(ask-car-spanner,
                       [plan(ask-ambiguous,[])]),
                  ask-ambiguous,
                  null
      ),

      alternative(plan(ask-car-spanner,
                       [plan(ask-car-unambiguous,[])]),
                  ask-car-unambiguous,
                  null
      )
]).



bmceleney 2006-12-19