input
stringlengths
10
828
output
stringlengths
5
107
public gregorian calendar get creation date return creation date
asigna el almac n de canciones
public void set creation date gregorian calendar value this creation date value
sets the value of the creation date property
public gregorian calendar get last modification date return last modification date
gets the value of the last modification date property
public void set last modification date gregorian calendar value this last modification date value
sets the value of the last modification date property
public void set field field value this field value
sets the value of the field property
public comparation get comparation return comparation
gets the value of the comparation property
public void set comparation comparation value this comparation value
sets the value of the operation property
public void set album string value this album value
sets the value of the album property
public void set rating float value this rating value
sets the value of the evaluation property
public void set id string value int int id 1 try int id integer parse int value catch number format exception nfe return if int id 1 this id int id
sets the value of the id property
public void set track int value this track value
sets the value of the track property
public float get evaluation return evaluation
gets the value of the evaluation property
public void set evaluation float value this evaluation value
sets the value of the evaluation property
private void update world with player position position position orientation orientation world set player position position world set player orientation orientation
set the players position and orientation within the world
public void build planning problem world current world list formula goal domain domain problem problem predicates current world get signature compute domain current world domain compute problem current world goal problem
builds a planning problem from a given world and a given goal that
public void export as pddl world current world list formula goal print writer domain writer print writer problem writer throws ioexception domain domain new domain problem problem new problem build planning problem current world goal domain problem new pddl output codec write to disk domain problem domain writer problem writer domain writer flush problem writer flush
builds a planning problem from a given world and a given goal
private void internal log string message parent add log entry game id message
add an entry to the game log
private effect make crisp effect list formula effects list effect conjuncts new array list effect for formula effect effects conjuncts add make crisp effect effect return new conjunction conjuncts
converts a list of formulas into an action effect in crisp representation
public void log string message internal log nlg message
send a message to the internal game log
public list atom get plan list formula goals throws ioexception return inst get plan goals
returns a plan that gets you from the current world state to
public void log string message inst log message
logs a message in the database
private goal make crisp goal list formula preconditions list goal conjuncts new array list goal for formula pre preconditions conjuncts add make crisp goal pre return new crisp planningproblem goal conjunction conjuncts
converts a list of formulas into an action goal in crisp representation
public void log start computation string type inst log start computation type
informs the system that you have started a computation
public void log end computation string type inst log end computation type
informs the system that you have ended a computation
public void log reference attempt string target object inst log reference attempt target object
logs an attempt by the nlg system to refer to a certain object
public void log reference attempt string target object internal log ref target object
add a log message whenever the system produces a referring expression
public void send string msg inst send msg
sends a message to the user
public discretizer get discretizer return discretizer
returns a discretizer that allows you to map between positions and orientations
public boolean is tutorial end return false
checks whether the last action caused the tutorial to end
synchronized public void log start computation string type if thread mx bean null if computation start times contains key type log warning nlg system logging start of type computation twice computation start times put type thread mx bean get current thread cpu time
required log entry the start time for this game run
public boolean is near string pos1 string pos2 return pos1 equals pos2
decides whether two positions are near each other
synchronized public void log end computation string type if thread mx bean null if computation start times contains key type log warning logged end of type computation without first logging start else long end time thread mx bean get current thread cpu time long so far get cpu time type cpu times put type so far end time computation start times get type computation start times remove type
required log entry the end time of this game run
synchronized public void send string msg if unsuccessful communication attempts max unsuccessful attempts try message m new text message msg internal log send m compute runtimes string ostream write object m ostream flush last sent m catch ioexception e logger log error while sending message e get message n this is harmless if it happens after the client was cancelled unsuccessful communication attempts
displays a text message on the users terminal
private string compute runtimes string string builder buf new string builder runtimes for string type cpu times key set buf append type cpu times get type 1000000 l buf append cpu times clear computation start times clear return buf to string
calculates the elapsed time for this run
public void add substitution variable v term t todo put the real invariant maintaining code back in copy concatenate new substitution v t this subst put v t
adds the mapping v t to this substitution
public substitution with variable v term t substitution ret new substitution copy this ret ret add substitution v t return ret
returns the result of adding the mapping v t to this substitution
public term apply term t if t instanceof variable variable v variable t if subst contains key v return subst get v else return t else return t
returns the result of applying this substitution to the term t
public void remove variable v subst remove v
removes the mapping for a variable from this substitution
public boolean applies to variable v return subst contains key v
tests whether this substitution contains a mapping for a
public string to pddl return to pddl default term presenter
returns a pddl representation of this formula relative to a default
public string get world name return worldname
worldname getter method
private void read data object input stream istream throws ioexception class not found exception worldname string istream read object timestamps list date istream read object messages list string istream read object
reads the data from the input file into the fields of the class
private boolean check goals achieved substitution empty subst new substitution for formula f world get goals if f is satisfied world empty subst return false return true
checks to see if all goal predicates are satisfied in the current world
public void set frame rate int fps if fps 0 throw new illegal argument exception frames per second cannot be less than one log level info attempting to run at fps fps preferred ticks per frame timer get resolution fps
set preferred frame rate
public float get frames per second float time timer get time start time float timer get resolution float fps frames time start time timer get time frames 0 return fps
gets the current frame rate
private void start frame frame start tick timer get time
code start frame code begin monitoring the current frame
private void end frame frames frame duration ticks timer get time frame start tick while frame duration ticks preferred ticks per frame long sleep time preferred ticks per frame frame duration ticks 1000 timer get resolution try thread sleep sleep time catch interrupted exception e log level warning error sleeping during main loop frame duration ticks timer get time frame start tick
code end frame code ends the current frame
public world read world file file throws saxexception ioexception parser configuration exception world world new world saxparser factory new instance new saxparser parse file new world parser world world add inferred atoms world compute actions world infer all types worlds add world world filenames put world get name file return world new planning problem exporter new grid discretizer 1 1 world export as pddl world world get goals new print writer new file writer domain lisp new print writer new file writer problem lisp system exit 0
construct a world from an xml definition stored in a file
public string get parameter type string par return parameter types get par
returns the type of a parameter with a given name
public world get random world return worlds get rand next int worlds size
chooses a known virtual world at random and returns it
public void add precondition formula pre preconditions add pre
adds a formula to this actions preconditions
public file get world filename string worldname return world filenames get worldname
returns the filename that a particular world was loaded from
public void add effect formula eff effects add eff
adds a formula to this actions effects
public atom get header return header
returns the header name paramaters of this action
private substitution get substitution atom header instance substitution subst new substitution for int i 0 i header get arguments size i subst add substitution variable header get arguments get i header instance get arguments get i return subst
matches the header of this action with the given ground atom
public boolean is applicable atom header instance world world substitution subst get substitution header instance for formula f preconditions if f is satisfied world subst system err println action header instance precondition f evaluates to false return false return true
tests whether the given instance of this action is applicable in
public boolean matches atom ground term return header get predicate equals ground term get predicate header get arguments size ground term get arguments size
tests whether this actions header matches a given ground term
public void add individual string name string type universe put name type
adds an individual with a given type to the universe
public void add atom atom a for term x a get arguments if x instanceof constant constant c constant x if universe contains key c get name universe put c get name top else if x instanceof position all seen positions add x else if x instanceof orientation all seen orientations add x true atoms add a
adds an atom to the list of true atoms
public boolean delete atom atom a if true atoms contains a true atoms remove a return true else return false
deletes an atom from the list of true atoms
public position get position string individual for atom a true atoms if a get predicate equals position constant a get arguments get 0 get name equals individual return position a get arguments get 1 return null
returns the position of an individual in space
public string get state string individual for atom a true atoms if a get predicate equals state constant a get arguments get 0 get name equals individual return constant a get arguments get 1 get name return null
returns the current state of some individual
public orientation get orientation string individual for atom a true atoms if a get predicate equals orientation constant a get arguments get 0 get name equals individual return orientation a get arguments get 1 return null
returns the current orientation of an object in space
public position get player position for atom a true atoms if a get predicate equals player position return position a get arguments get 0 return null
returns the current position of the player in space
public void set player position position position list term args new array list term args add position list atom to delete new array list atom 1 for atom a true atoms if a get predicate equals player position to delete add a true atoms remove all to delete true atoms add new atom player position args
moves the player to a different position
public orientation get player orientation for atom a true atoms if a get predicate equals player orientation return orientation a get arguments get 0 return null
returns the current orientation of the player
public void set player orientation orientation orientation list term args new array list term args add orientation list atom to delete new array list atom 1 for atom a true atoms if a get predicate equals player orientation to delete add a true atoms remove all to delete true atoms add new atom player orientation args
changes the players orientation
public position get start tile for atom a true atoms if a get predicate equals start tile return position a get arguments get 0 return null
returns the position of the start tile
public boolean is adjacent position pos1 position pos2 orientation ori return is near pos1 add ori pos2
tests whether two positions are adjacent given a certain orientation
public boolean is near position pos1 position pos2 return pos1 distance pos2 nearness max distance
tests whether two positions are near to each other
public boolean is true atom a if is type atom a return evaluate type atom a else if is near atom a return evaluate near atom a else if is adjacent atom a return evaluate adjacent atom a else if is accessible atom a return evaluate accessible atom a else if is next orientation atom a return evaluate next orientation atom a else boolean contains non symbolic false for term t a get arguments if t instanceof constant contains non symbolic true if contains non symbolic return evaluate non symbolic a else return true atoms contains a
tests whether a given atom is true
public string retrieve game events int game id list date timestamps list string messages throws sqlexception string ret null synchronized select game data select game data set int 1 game id result set rs execute query retry once select game data while rs next ret rs get string world name rs close synchronized select game log select game log set int 1 game id result set rs execute query retry once select game log timestamps clear messages clear while rs next timestamps add rs get timestamp timestamp messages add rs get string message rs close return ret
retrieves the events that occurred during a given game
public void add action action a actions add a
adds an action to the world
public action find action atom header for action a actions if a matches header return a return null
retrieves the action whose header matches the given ground
public action find action string name for action a actions if a get header get predicate equals name return a return null
retrieves the action with the given name
public string get type string individual return universe get individual
returns the type of a given individual
public void close try if file null file close file null catch exception e
closes the lookup service
public boolean is physical object string x return get type x equals top
tests whether some individual represents a physical object
public country get country long ip address if file null dboptions geoip memory cache 0 throw new illegal state exception database has been closed int ret seek country ip address country begin if ret 0 return unknown country else return new country country code ret country name ret
returns the country the ip address is in
public void add inferred atoms for string x get universe if get type x equals wall get type x equals safe for atom a get blocked atoms x true atoms add a if get type x equals door if get state x equals closed for atom a get blocked atoms x true atoms add a else for atom a get not blocked atoms x true atoms add a if alarmed equals get state x true atoms add new atom alarmed get position x
adds inferred atoms such as blocked and alarmed to the world state
public string get connection status if connection null return unconnected at url else try execute query retry once test query return connected to url catch sqlexception e return invalid connection to url
returns the status of this database connection
public string retrieve game events int game id list date timestamps list string messages throws sqlexception string ret null synchronized select game data select game data set int 1 game id result set rs execute query retry once select game data while rs next ret rs get string world name rs close synchronized select game log select game log set int 1 game id result set rs execute query retry once select game log timestamps clear messages clear while rs next timestamps add new date rs get long timestamp ms messages add rs get string message rs close return ret
retrieves the events that occurred during a given game
public void shutdown finished true interrupt
shut down the message sending thread
public void clear if debug system err println eq clear queue event queue event queue clear interrupt
clear the message queue
public world read world file file throws ioexception parse exception world world give world parser world parser parse new file reader file world world new world saxparser factory new instance new saxparser parse file new world parser world worlds add world world filenames put world get name file return world new planning problem exporter new grid discretizer 1 1 world export as pddl world world get goals new print writer new file writer domain lisp new print writer new file writer problem lisp system exit 0
construct a world from an xml definition stored in a file
public jcomponent create swing component world map map create image map room name to color new hash map string color next color 0 paint rooms map list wall walls map compute walls paint walls walls return new jlabel new image icon out
paint map into a jcomponent
public boolean is applicable atom header instance world world substitution subst get substitution header instance for formula f preconditions if f is satisfied world subst system err println action header instance precondition f subst evaluates to false return false return true
tests whether the given instance of this action is applicable in
public void add individual string name string type universe put name type if type equals top true atoms add new atom type new constant name
adds an individual with a given type to the universe
public void perform action input action event evt incr load identity if lock axis null node get local rotation get rotation column 1 temp va temp va normalize local incr from angle normal axis speed evt get time temp va else incr from angle normal axis speed evt get time lock axis node get local rotation from rotation matrix incr mult node get local rotation to rotation matrix temp ma temp mb node get local rotation normalize
code perform action code rotates the camera about its up vector or
private void update pivot int obj index if have changed obj index return have changed obj index true int parent index parent indexes obj index if parent index 1 update pivot parent index pivots obj index interpolate transforms begin point time look obj index end point time look obj index delta if parent index 1 pivots obj index combine with parent pivots parent index
called by update and itself recursivly
public void set min time float min time if keyframes null keyframes size 0 float first frame keyframes get 0 time float last frame keyframes get keyframes size 1 time if min time first frame min time first frame if min time last frame min time last frame cur time min time super set min time min time
overridden by spatial transformer to always set a time inside the first
public void set max time float max time if keyframes null keyframes size 0 float first frame keyframes get 0 time float last frame keyframes get keyframes size 1 time if max time first frame max time first frame if max time last frame max time last frame super set max time max time
overridden by spatial transformer to always set a time inside the first
public void perform action input action event evt vector3f diff null if cn get camera is parallel projection diff cn get camera get direction mult speed evt get time else diff cn get camera get up mult speed evt get time if checker has collision continuous cn get camera get location diff vector3f dest location cn get camera get location add diff cn set local translation dest location
code perform action code moves the camera node along its positive
public vector3f get lock axis return lock axis
returns the axis that is currently locked
public void set rotation int index in st float time quaternion rot point in time to add find time time to add set rotation index in st rot
sets object with index code index in st code to rotate by
public void set position int index in st float time vector3f position point in time to add find time time to add set translation index in st position
sets object with index code index in st code to translate by
public void set scale int index in st float time vector3f scale point in time to add find time time to add set scale index in st scale
sets object with index code index in st code to scale by
public void interpolate missing if keyframes size 1 fill trans fill rots fill scales for int obj index 0 obj index num objects obj index pivots obj index apply to spatial to change obj index
this must be called one time once all translations rotations scales have
public int get num objects return num objects
returns the number of objects used by this spatial transformer
public void build planning problem world current world list formula goal domain domain problem problem predicates current world get signature compute domain current world domain compute problem current world goal domain problem
builds a planning problem from a given world and a given goal that