Importation du code depuis GitHub

This commit is contained in:
gasc 2021-08-22 13:07:04 +02:00
commit 8cf7b2f506
30 changed files with 424975 additions and 0 deletions

674
LICENSE Normal file
View file

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

10
README.md Normal file
View file

@ -0,0 +1,10 @@
# TDDC17AICourse
Sharing of my labs carried out during the TDDC17 course at Linköping University (HT 2020).
## Lab 4
Commands used in lab 4 to use planner algorithms:
```bash
$ ipp -o task1_domain.pddl -f task1_pb1.pddl
$ ff -o task1_domain.pddl -f task1_pb1.pddl
$ lama task1_domain.pddl task1_pb1.pddl
```

434
lab1/myvacuumagent.py Normal file
View file

@ -0,0 +1,434 @@
from lab1.liuvacuum import *
DEBUG_OPT_DENSEWORLDMAP = False
AGENT_STATE_UNKNOWN = 0
AGENT_STATE_WALL = 1
AGENT_STATE_CLEAR = 2
AGENT_STATE_DIRT = 3
AGENT_STATE_HOME = 4
AGENT_DIRECTION_NORTH = 0
AGENT_DIRECTION_EAST = 1
AGENT_DIRECTION_SOUTH = 2
AGENT_DIRECTION_WEST = 3
def direction_to_string(cdr):
cdr %= 4
return "NORTH" if cdr == AGENT_DIRECTION_NORTH else\
"EAST" if cdr == AGENT_DIRECTION_EAST else\
"SOUTH" if cdr == AGENT_DIRECTION_SOUTH else\
"WEST" #if dir == AGENT_DIRECTION_WEST
"""
Internal state of a vacuum agent
"""
class MyAgentState:
def __init__(self, width, height):
# Initialize perceived world state
self.world = [[AGENT_STATE_UNKNOWN for _ in range(height)] for _ in range(width)]
self.world[1][1] = AGENT_STATE_HOME
# Agent internal state
self.last_action = ACTION_NOP
self.direction = AGENT_DIRECTION_EAST
self.pos_x = 1
self.pos_y = 1
# Metadata
self.world_width = width
self.world_height = height
"""
Update perceived agent location and orientation
"""
def update_position(self, bump):
if not bump and self.last_action == ACTION_FORWARD:
if self.direction == AGENT_DIRECTION_EAST:
self.pos_x += 1
elif self.direction == AGENT_DIRECTION_SOUTH:
self.pos_y += 1
elif self.direction == AGENT_DIRECTION_WEST:
self.pos_x -= 1
elif self.direction == AGENT_DIRECTION_NORTH:
self.pos_y -= 1
elif self.last_action == ACTION_TURN_LEFT:
if self.direction == AGENT_DIRECTION_EAST:
self.direction = AGENT_DIRECTION_NORTH
elif self.direction == AGENT_DIRECTION_SOUTH:
self.direction = AGENT_DIRECTION_EAST
elif self.direction == AGENT_DIRECTION_WEST:
self.direction = AGENT_DIRECTION_SOUTH
elif self.direction == AGENT_DIRECTION_NORTH:
self.direction = AGENT_DIRECTION_WEST
elif self.last_action == ACTION_TURN_RIGHT:
if self.direction == AGENT_DIRECTION_EAST:
self.direction = AGENT_DIRECTION_SOUTH
elif self.direction == AGENT_DIRECTION_SOUTH:
self.direction = AGENT_DIRECTION_WEST
elif self.direction == AGENT_DIRECTION_WEST:
self.direction = AGENT_DIRECTION_NORTH
elif self.direction == AGENT_DIRECTION_NORTH:
self.direction = AGENT_DIRECTION_EAST
"""
Update perceived or inferred information about a part of the world
"""
def update_world(self, x, y, info):
self.world[x][y] = info
"""
Dumps a map of the world as the agent knows it
"""
def print_world_debug(self):
for y in range(self.world_height):
for x in range(self.world_width):
if self.world[x][y] == AGENT_STATE_UNKNOWN:
print("?" if DEBUG_OPT_DENSEWORLDMAP else " ? ", end="")
elif self.world[x][y] == AGENT_STATE_WALL:
print("#" if DEBUG_OPT_DENSEWORLDMAP else " # ", end="")
elif self.world[x][y] == AGENT_STATE_CLEAR:
print("." if DEBUG_OPT_DENSEWORLDMAP else " . ", end="")
elif self.world[x][y] == AGENT_STATE_DIRT:
print("D" if DEBUG_OPT_DENSEWORLDMAP else " D ", end="")
elif self.world[x][y] == AGENT_STATE_HOME:
print("H" if DEBUG_OPT_DENSEWORLDMAP else " H ", end="")
print() # Newline
print() # Delimiter post-print
"""
Vacuum agent
"""
class MyVacuumAgent(Agent):
"""
Init function, everything here is execute once at the beginning
"""
def __init__(self, world_width, world_height, log):
super().__init__(self.execute)
self.initial_random_actions = 10
self.iteration_counter = 1000
self.state = MyAgentState(world_width, world_height)
self.log = log
# Arrived variable for the goto function
self.arrived = True
# Arrived variable for the go_to_with_pathfinder function
self.arrived_destination = True
# If the agent has finished the cleaning
self.finished = False
# Goto coordinates for the goto function
self.goto_x = 1
self.goto_y = 1
# Goto coordinates for the go_to_with_pathfinder function
self.destination_x = 1
self.destination_y = 1
# If we need to re-calculate our destination
self.reset_destination = True
# Different list in agent memory
self.waypoint = [] # Memory for next waypoint coordinates
self.slist = [] # List of waypoint to go at the agent destination
# At the beginning, we assume that the zone is surrounded by wall
for i in range(0, world_width):
self.state.update_world(i, 0, AGENT_STATE_WALL)
self.state.update_world(i, world_height - 1, AGENT_STATE_WALL)
for j in range(1, world_height - 1):
self.state.update_world(0, j, AGENT_STATE_WALL)
self.state.update_world(world_width - 1, j, AGENT_STATE_WALL)
"""
Function which move the agent to a ramdom start position
"""
def move_to_random_start_position(self, bump):
action = random()
self.initial_random_actions -= 1
self.state.update_position(bump)
self.log("Actual direction: " + direction_to_string(self.state.direction))
if action < 0.1666666: # 1/6 chance
self.state.last_action = ACTION_TURN_LEFT
return ACTION_TURN_LEFT
elif action < 0.3333333: # 1/6 chance
self.state.last_action = ACTION_TURN_RIGHT
return ACTION_TURN_RIGHT
else: # 4/6 chance
self.state.last_action = ACTION_FORWARD
return ACTION_FORWARD
"""
A basic "go to" function which does not consider wall
"""
def goto(self, bump, dirt):
self.state.update_position(bump)
self.log("Actual direction: " + direction_to_string(self.state.direction))
self.log("Next waypoint: {}, {}".format(self.goto_x, self.goto_y))
if dirt:
self.state.update_world(self.state.pos_x, self.state.pos_y, AGENT_STATE_DIRT)
self.log("DIRT -> choosing SUCK action!")
self.state.last_action = ACTION_SUCK
return ACTION_SUCK
else:
self.state.update_world(self.state.pos_x, self.state.pos_y, AGENT_STATE_CLEAR)
if (self.goto_x == self.state.pos_x and self.goto_y == self.state.pos_y) or bump:
self.arrived = True
self.log("Arrived to the target point")
self.state.last_action = ACTION_NOP
return ACTION_NOP
if abs(self.state.pos_x - self.goto_x) >= abs(self.state.pos_y - self.goto_y):
if self.state.pos_x - self.goto_x > 0: # Need to go WEST
if self.state.direction == AGENT_DIRECTION_WEST:
return ACTION_FORWARD
elif self.state.direction == AGENT_DIRECTION_SOUTH:
return ACTION_TURN_RIGHT
else:
return ACTION_TURN_LEFT
else: # Need to go EAST
if self.state.direction == AGENT_DIRECTION_EAST:
return ACTION_FORWARD
elif self.state.direction == AGENT_DIRECTION_NORTH:
return ACTION_TURN_RIGHT
else:
return ACTION_TURN_LEFT
else:
if self.state.pos_y - self.goto_y > 0: # Need to go NORTH
if self.state.direction == AGENT_DIRECTION_NORTH:
return ACTION_FORWARD
elif self.state.direction == AGENT_DIRECTION_WEST:
return ACTION_TURN_RIGHT
else:
return ACTION_TURN_LEFT
else: # Need to go SOUTH
if self.state.direction == AGENT_DIRECTION_SOUTH:
return ACTION_FORWARD
elif self.state.direction == AGENT_DIRECTION_EAST:
return ACTION_TURN_RIGHT
else:
return ACTION_TURN_LEFT
"""
A pathfinding algorithm, based on the BFS algorithm
"""
def pathfinding(self, target_x, target_y):
# Class for node used in the search
class Node:
def __init__(self, parent=None, x=-1, y=-1):
self.x = x
self.y = y
self.parent = parent
def __eq__(self, other):
return self.x == other.x and self.y == other.y
# Start and end nodes
start = Node(None, self.state.pos_x, self.state.pos_y)
end = Node(None, target_x, target_y)
# List containing the nodes to explore (By order of priority)
queue = [start]
# List of explored nodes
explored = []
# List which will be returned by the program containing
# the coordinates to follow to reach the targeted point
slist = []
# While there is node to explore
while queue:
# If the queue is to big, we assume that there is a problem
if len(queue) > 200:
break
# We take the first node in the queue
node = queue.pop(0)
# If it is the destination
if node == end:
print("Trying to go at : {}; {}".format(target_x, target_y))
print("Solution found : ")
n = node
# We return the path found
while n.parent:
print("x: {}, y: {}".format(n.x, n.y))
slist.append([n.x, n.y])
n = n.parent
# and stop the processing
break
# If we never explored this node
elif node not in explored:
explored.append(node)
# For each adjacent node, if it is not a wall,
# we add it to the queue
if self.state.world[node.x - 1][node.y] != AGENT_STATE_WALL:
queue.append(Node(node, node.x-1, node.y))
if self.state.world[node.x + 1][node.y] != AGENT_STATE_WALL:
queue.append(Node(node, node.x+1, node.y))
if self.state.world[node.x][node.y - 1] != AGENT_STATE_WALL:
queue.append(Node(node, node.x, node.y - 1))
if self.state.world[node.x][node.y + 1] != AGENT_STATE_WALL:
queue.append(Node(node, node.x, node.y+1))
# If we don't find any solution
if not slist:
# We consider that the place in inaccessible
self.state.update_world(end.x, end.y, AGENT_STATE_WALL)
self.log("Find a inaccessible place, marking as a wall ##")
print("Overload! Inaccessible place!")
return slist
"""
A "go to" function which implement the pathfinding algorithm using the goto function
"""
def go_to_with_pathfinder(self, bump, dirt):
# If we start or if we need to reset the path
if self.reset_destination:
print("Launching the pathfinding algorithm.")
self.slist = self.pathfinding(self.destination_x, self.destination_y)
# If we have a path, we follow it
if self.slist:
# If the agent move correctly the previous time
if not bump:
self.waypoint = self.slist.pop()
self.goto_x = self.waypoint[0]
self.goto_y = self.waypoint[1]
self.arrived = False
action = self.goto(bump, dirt)
self.state.last_action = action
self.reset_destination = False
return action
# else (whether we arrived or we don't find a path), we assume
# that we will not go further
else:
self.reset_destination = True
self.arrived_destination = True
self.state.last_action = ACTION_NOP
return ACTION_NOP
pass
"""
The execute function, which is call at each turn
"""
def execute(self, percept):
# If the agent has finished, we do nothing
if self.finished:
return ACTION_NOP
###########################
# DO NOT MODIFY THIS CODE #
###########################
bump = percept.attributes["bump"]
dirt = percept.attributes["dirt"]
home = percept.attributes["home"]
# Move agent to a randomly chosen initial position
if self.initial_random_actions > 0:
self.log("Moving to random start position ({} steps left)".format(self.initial_random_actions))
return self.move_to_random_start_position(bump)
# Finalize randomization by properly updating position (without subsequently changing it)
elif self.initial_random_actions == 0:
self.initial_random_actions -= 1
self.state.update_position(bump)
self.state.last_action = ACTION_SUCK
self.log("Processing percepts after position randomization")
return ACTION_SUCK
########################
# START MODIFYING HERE #
########################
# Logging position and orientation
self.log("Position: ({}, {})\t\tDirection: {}".format(self.state.pos_x, self.state.pos_y,
direction_to_string(self.state.direction)))
if bump:
# Not arrived, but this way we force our agent to re-calculate its path
self.arrived = True
self.reset_destination = True
# Get an xy-offset pair based on where the agent is facing
offset = [(0, -1), (1, 0), (0, 1), (-1, 0)][self.state.direction]
# Mark the tile at the offset from the agent as a wall (since the agent bumped into it)
self.state.update_world(self.state.pos_x + offset[0], self.state.pos_y + offset[1], AGENT_STATE_WALL)
# While we aren't arrived, we refer to the goto function
if not self.arrived:
action = self.goto(bump, dirt)
self.state.last_action = action
return action
# While we aren't arrived, we refer to the go_to_with_pathfinder function
elif not self.arrived_destination:
return self.go_to_with_pathfinder(bump, dirt)
# Max iterations for the agent
if self.iteration_counter < 1:
if self.iteration_counter == 0:
self.iteration_counter -= 1
self.log("Iteration counter is now 0. Halting!")
self.log("Performance: {}".format(self.performance))
return ACTION_NOP
self.iteration_counter -= 1
# Track position of agent
self.state.update_position(bump)
# Update perceived state of current tile
if dirt:
self.state.update_world(self.state.pos_x, self.state.pos_y, AGENT_STATE_DIRT)
else:
self.state.update_world(self.state.pos_x, self.state.pos_y, AGENT_STATE_CLEAR)
# Debug
self.state.print_world_debug()
# Variables used to determine the closest unknown place
closest_unk_range = self.state.world_height + self.state.world_width + 1
closest_x = 1
closest_y = 1
find_new = False
# Determination of the nearest unknown location
for i in range(self.state.world_width):
for j in range(self.state.world_height):
if self.state.world[i][j] == AGENT_STATE_UNKNOWN and (
abs(self.state.pos_x - i) + abs(self.state.pos_y - j)) < closest_unk_range:
find_new = True
closest_unk_range = (abs(self.state.pos_x - i) + abs(self.state.pos_y - j))
closest_x = i
closest_y = j
# If we find a new place to go
if find_new:
self.log("Going to unknown places : ({};{})".format(closest_x, closest_y))
self.destination_x = closest_x
self.destination_y = closest_y
return self.go_to_with_pathfinder(bump, dirt)
# If not, we have finished, we go home
if home:
self.log("Finished !")
self.log("Performance: {}".format(self.performance))
self.finished = True
# Finally we are at home
else:
self.log("Job done, going back home.")
self.destination_x = 1
self.destination_y = 1
return self.go_to_with_pathfinder(bump, dirt)
# Useless
self.state.last_action = ACTION_NOP
return ACTION_NOP

View file

@ -0,0 +1,9 @@
package searchCustom;
public class CustomBreadthFirstSearch extends CustomGraphSearch{
public CustomBreadthFirstSearch(int maxDepth){
super(false);
//System.out.println("Change line above in \"CustomBreadthFirstSearch.java\"! --> done.");
}
};

View file

@ -0,0 +1,8 @@
package searchCustom;
public class CustomDepthFirstSearch extends CustomGraphSearch{
public CustomDepthFirstSearch(int maxDepth){
super(true);
//System.out.println("Change line above in \"CustomDepthFirstSearch.java\"! --> done.");
}
};

141
lab2/CustomGraphSearch.java Normal file
View file

@ -0,0 +1,141 @@
package searchCustom;
import java.util.ArrayList;
import java.util.HashSet;
import searchShared.NodeQueue;
import searchShared.Problem;
import searchShared.SearchObject;
import searchShared.SearchNode;
import world.GridPos;
public class CustomGraphSearch implements SearchObject {
private HashSet<SearchNode> explored;
private NodeQueue frontier;
protected ArrayList<SearchNode> path;
private boolean insertFront;
/**
* The constructor tells graph search whether it should insert nodes to front or back of the frontier
*/
public CustomGraphSearch(boolean bInsertFront) {
insertFront = bInsertFront;
}
/**
* Implements "graph search", which is the foundation of many search algorithms
*/
public ArrayList<SearchNode> search(Problem problem) {
// The frontier is a queue of expanded SearchNodes not processed yet
frontier = new NodeQueue();
// The explored set is a set of nodes that have been processed
explored = new HashSet<SearchNode>();
// The start state is given
GridPos startState = (GridPos) problem.getInitialState();
// Initialise the frontier with the start state
frontier.addNodeToFront(new SearchNode(startState));
// Path will be empty until we find the goal.
path = new ArrayList<SearchNode>();
/*
* Note on how java and this program work:
* -ArrayList are just resizable array. "<>" contains the type of the listed objects
* -Structures :
* while (boolean) {}
* while (a > 0) {}
* for (int i = 0; i < 5; i++){} --> 5 iterations
* for (String i : StringList){} --> Iterations on all the objects in the list
* -Class used here:
* -SearchNode --> Equivalent of the "Node" class in the Python program. Represent a node.
* -Problem --> Class containing lot of informations on the problem
* like the reachable states from a position, the start, the end
* -GridPos --> represent a position (with x and y coordinates)
*/
// While we have something to explore
while (frontier.size() > 0) {
// Get the first node on the list
SearchNode Node = frontier.removeFirst();
// We check if it is our destination
if (problem.isGoalState(Node.getState())) {
return path = Node.getPathFromRoot();
} // if not, we continue
// Get the list of children of the current node
ArrayList<GridPos> childPosition = problem.getReachableStatesFrom(Node.getState());
// For every child in the list
for (GridPos position : childPosition) {
// Creating a new node
SearchNode childNode = new SearchNode(position, Node);
// If we have not explored the node
if (explored.contains(childNode) == false) {
// Adding the child node to the frontier
// Front --> DFS (LIFO queue)
// Back --> BFS (FIFO queue)
if (insertFront) {
frontier.addNodeToFront(childNode);
}
else {
frontier.addNodeToBack(childNode);
}
// We add the node to explored node
explored.add(childNode);
}
}
}
/* Some hints:
* -Read early part of chapter 3 in the book!
* -You are free to change anything how you wish as long as the program runs, but some structure is given to help you.
* -You can Google for "javadoc <class>" if you are uncertain of what you can do with a particular Java type.
*
* -SearchNodes are the nodes of the search tree and contains the relevant problem state, in this case x,y position (GridPos) of the agent
* --You can create a new search node from a state by: SearchNode childNode = new SearchNode(childState, currentNode);
* --You can also extract the state by .getState() method
* --All search structures use search nodes, but the problem object only speaks in state, so you may need to convert between them
*
* -The frontier is a queue of search nodes, open this class to find out what you can do with it!
*
* -If you are unfamiliar with Java, the "HashSet<SearchNode>" used for the explored set means a set of SearchNode objects.
* --You can add nodes to the explored set, or check if it contains a node!
*
* -To get the child states (adjacent grid positions that are not walls) of a particular search node, do: ArrayList<GridPos> childStates = p.getReachableStatesFrom(currentState);
*
* -Depending on the addNodesToFront boolean variable, you may need to do something with the frontier... (see book)
*
* -You can check if you have reached the goal with p.isGoalState(NodeState)
*
* When the goal is found, the path to be returned can be found by: path = node.getPathFromRoot();
*/
/* Note: Returning an empty path signals that no path exists */
return path;
}
/*
* Functions below are just getters used externally by the program
*/
public ArrayList<SearchNode> getPath() {
return path;
}
public ArrayList<SearchNode> getFrontierNodes() {
return new ArrayList<SearchNode>(frontier.toList());
}
public ArrayList<SearchNode> getExploredNodes() {
return new ArrayList<SearchNode>(explored);
}
public ArrayList<SearchNode> getAllExpandedNodes() {
ArrayList<SearchNode> allNodes = new ArrayList<SearchNode>();
allNodes.addAll(getFrontierNodes());
allNodes.addAll(getExploredNodes());
return allNodes;
}
}

20
lab3/bayes.jnlp Normal file
View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
codebase="http://www.aispace.org/"
>
<information>
<title>Belief and Decision Networks</title>
<vendor>AIspace</vendor>
<homepage href="www.aispace.org" />
</information>
<offline-allowed/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+" />
<jar href="bayes/bayes.jar"/>
</resources>
<application-desc />
</jnlp>

263
lab3/lab3_Mr_HS_v2.xml Normal file
View file

@ -0,0 +1,263 @@
<?xml version="1.0" encoding="UTF-8"?>
<BIF VERSION="0.3" xmlns="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3 http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3/XMLBIFv0_3.xsd">
<NETWORK>
<NAME>Nuclear Power Station</NAME>
<PROPERTY>detailed = </PROPERTY>
<PROPERTY>short = </PROPERTY>
<VARIABLE TYPE="nature">
<NAME>WaterLeak</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7367.91845703125, 5357.0380859375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>WaterLeakWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7195.8505859375, 5497.32470703125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>IcyWeather</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7565.81103515625, 5097.51025390625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailure</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7121.32080078125, 5349.66455078125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailureWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (6830.72802734375, 5504.23828125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Meltdown</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7467.087890625, 5603.3173828125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Battery</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7761.697265625, 5233.7236328125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Radio</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7667.05322265625, 5364.93359375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Ignition</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7914.4169921875, 5364.93359375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Gas</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8158.5546875, 5373.53759765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Start</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8051.0048828125, 5523.03076171875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Moves</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8051.0048828125, 5678.9775390625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Survives</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7638.01513671875, 5822.0185546875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Bicycle_works</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7636.93896484375, 5681.12890625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>HS_is_awake</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<OBS>F</OBS>
<PROPERTY>position = (7004.9658203125, 5804.48974609375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>HS_do_something_not_stupid</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7317.30908203125, 5806.892578125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>HS_remark_irregularity</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7008.78662109375, 5680.53564453125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Pay_day</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (6790.44482421875, 5682.78271484375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Warning(s)?</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<OBS>T</OBS>
<PROPERTY>position = (7014.93408203125, 5581.3759765625)</PROPERTY>
</VARIABLE>
<DEFINITION>
<FOR>WaterLeak</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.2 0.8 0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>WaterLeakWarning</FOR>
<GIVEN>WaterLeak</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>IcyWeather</FOR>
<TABLE>0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailure</FOR>
<TABLE>0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailureWarning</FOR>
<GIVEN>PumpFailure</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Meltdown</FOR>
<GIVEN>WaterLeak</GIVEN>
<GIVEN>PumpFailure</GIVEN>
<GIVEN>HS_do_something_not_stupid</GIVEN>
<TABLE>0.15 0.85 0.2 0.8 0.05 0.95 0.1 0.9 0.1 0.9 0.15 0.85 0.001 0.999 0.001 0.999</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Battery</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.8 0.2 0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Radio</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Ignition</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Gas</FOR>
<TABLE>0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Start</FOR>
<GIVEN>Ignition</GIVEN>
<GIVEN>Gas</GIVEN>
<TABLE>0.95 0.05 0.0 1.0 0.0 1.0 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Moves</FOR>
<GIVEN>Start</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Survives</FOR>
<GIVEN>Meltdown</GIVEN>
<GIVEN>Moves</GIVEN>
<GIVEN>Bicycle_works</GIVEN>
<TABLE>0.9 0.1 0.8 0.2 0.6 0.4 0.0 1.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Bicycle_works</FOR>
<TABLE>0.9 0.1</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>HS_is_awake</FOR>
<GIVEN>Pay_day</GIVEN>
<TABLE>1.0 0.0 0.5 0.5</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>HS_do_something_not_stupid</FOR>
<GIVEN>HS_is_awake</GIVEN>
<GIVEN>HS_remark_irregularity</GIVEN>
<TABLE>0.7 0.3 0.05 0.95 0.0 1.0 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>HS_remark_irregularity</FOR>
<GIVEN>WaterLeakWarning</GIVEN>
<GIVEN>PumpFailureWarning</GIVEN>
<GIVEN>HS_is_awake</GIVEN>
<TABLE>0.9 0.1 0.0 1.0 0.7 0.3 0.0 1.0 0.7 0.3 0.0 1.0 0.05 0.95 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Pay_day</FOR>
<TABLE>0.03 0.97</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Warning(s)?</FOR>
<GIVEN>WaterLeakWarning</GIVEN>
<GIVEN>PumpFailureWarning</GIVEN>
<TABLE>1.0 0.0 1.0 0.0 1.0 0.0 0.0 1.0</TABLE>
</DEFINITION>
</NETWORK>
</BIF>

192
lab3/lab3_bicycle.xml Normal file
View file

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<BIF VERSION="0.3" xmlns="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3 http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3/XMLBIFv0_3.xsd">
<NETWORK>
<NAME>Nuclear Power Station</NAME>
<PROPERTY>detailed = </PROPERTY>
<PROPERTY>short = </PROPERTY>
<VARIABLE TYPE="nature">
<NAME>WaterLeak</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7384.1337890625, 5342.26220703125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>WaterLeakWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7260.0986328125, 5584.7626953125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>IcyWeather</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7579.63818359375, 5085.86474609375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailure</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7123.5244140625, 5338.97509765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailureWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7029.26171875, 5583.60107421875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Meltdown</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7482.10693359375, 5585.57177734375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Battery</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7773.16650390625, 5220.43408203125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Radio</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7679.6611328125, 5350.0634765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Ignition</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7924.04248046875, 5350.0634765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Gas</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8165.234375, 5358.56396484375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Start</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8058.9833984375, 5506.25390625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Moves</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8058.9833984375, 5660.31982421875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Survives</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7650.9716796875, 5801.63623046875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Bicycle_works</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7649.91162109375, 5662.4453125)</PROPERTY>
</VARIABLE>
<DEFINITION>
<FOR>WaterLeak</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.2 0.8 0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>WaterLeakWarning</FOR>
<GIVEN>WaterLeak</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>IcyWeather</FOR>
<TABLE>0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailure</FOR>
<TABLE>0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailureWarning</FOR>
<GIVEN>PumpFailure</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Meltdown</FOR>
<GIVEN>WaterLeak</GIVEN>
<GIVEN>PumpFailure</GIVEN>
<TABLE>0.2 0.8 0.1 0.9 0.15 0.85 0.001 0.999</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Battery</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.8 0.2 0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Radio</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Ignition</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Gas</FOR>
<TABLE>0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Start</FOR>
<GIVEN>Ignition</GIVEN>
<GIVEN>Gas</GIVEN>
<TABLE>0.95 0.05 0.0 1.0 0.0 1.0 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Moves</FOR>
<GIVEN>Start</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Survives</FOR>
<GIVEN>Meltdown</GIVEN>
<GIVEN>Moves</GIVEN>
<GIVEN>Bicycle_works</GIVEN>
<TABLE>0.9 0.1 0.8 0.2 0.6 0.4 0.0 1.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Bicycle_works</FOR>
<TABLE>0.9 0.1</TABLE>
</DEFINITION>
</NETWORK>
</BIF>

179
lab3/lab3_new_car.xml Normal file
View file

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<BIF VERSION="0.3" xmlns="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3 http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3/XMLBIFv0_3.xsd">
<NETWORK>
<NAME>Nuclear Power Station</NAME>
<PROPERTY>detailed = </PROPERTY>
<PROPERTY>short = </PROPERTY>
<VARIABLE TYPE="nature">
<NAME>WaterLeak</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7384.1337890625, 5342.26220703125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>WaterLeakWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7260.0986328125, 5584.7626953125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>IcyWeather</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7579.63818359375, 5085.86474609375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailure</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7123.5244140625, 5338.97509765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailureWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7029.26171875, 5583.60107421875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Meltdown</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7482.10693359375, 5585.57177734375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Battery</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7773.16650390625, 5220.43408203125)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Radio</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7679.6611328125, 5350.0634765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Ignition</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7924.04248046875, 5350.0634765625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Gas</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8165.234375, 5358.56396484375)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Start</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8058.9833984375, 5506.25390625)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Moves</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (8058.9833984375, 5660.31982421875)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Survives</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (7650.9716796875, 5801.63623046875)</PROPERTY>
</VARIABLE>
<DEFINITION>
<FOR>WaterLeak</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.2 0.8 0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>WaterLeakWarning</FOR>
<GIVEN>WaterLeak</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>IcyWeather</FOR>
<TABLE>0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailure</FOR>
<TABLE>0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailureWarning</FOR>
<GIVEN>PumpFailure</GIVEN>
<TABLE>0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Meltdown</FOR>
<GIVEN>WaterLeak</GIVEN>
<GIVEN>PumpFailure</GIVEN>
<TABLE>0.2 0.8 0.1 0.9 0.15 0.85 0.001 0.999</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Battery</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE>0.8 0.2 0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Radio</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Ignition</FOR>
<GIVEN>Battery</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Gas</FOR>
<TABLE>0.95 0.05</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Start</FOR>
<GIVEN>Ignition</GIVEN>
<GIVEN>Gas</GIVEN>
<TABLE>0.95 0.05 0.0 1.0 0.0 1.0 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Moves</FOR>
<GIVEN>Start</GIVEN>
<TABLE>0.95 0.05 0.0 1.0</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Survives</FOR>
<GIVEN>Meltdown</GIVEN>
<GIVEN>Moves</GIVEN>
<TABLE>0.8 0.2 0.0 1.0 1.0 0.0 1.0 0.0</TABLE>
</DEFINITION>
</NETWORK>
</BIF>

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="US-ASCII"?>
<BIF VERSION="0.3" xmlns="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3 http://www.cs.ubc.ca/labs/lci/fopi/ve/XMLBIFv0_3/XMLBIFv0_3.xsd">
<NETWORK>
<NAME>Nuclear Power Station</NAME>
<VARIABLE TYPE="nature">
<NAME>WaterLeak</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (53.0, -52.0)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>WaterLeakWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (112.0, 49.0)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>IcyWeather</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (53.0, -144.0)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailure</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (-145.0, -54.0)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>PumpFailureWarning</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (-203.0, 47.0)</PROPERTY>
</VARIABLE>
<VARIABLE TYPE="nature">
<NAME>Meltdown</NAME>
<OUTCOME>T</OUTCOME>
<OUTCOME>F</OUTCOME>
<PROPERTY>position = (-60.0, 140.0)</PROPERTY>
</VARIABLE>
<DEFINITION>
<FOR>WaterLeak</FOR>
<GIVEN>IcyWeather</GIVEN>
<TABLE> 0.2 0.8 0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>WaterLeakWarning</FOR>
<GIVEN>WaterLeak</GIVEN>
<TABLE> 0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>IcyWeather</FOR>
<TABLE> 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailure</FOR>
<TABLE> 0.1 0.9</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>PumpFailureWarning</FOR>
<GIVEN>PumpFailure</GIVEN>
<TABLE> 0.9 0.1 0.05 0.95</TABLE>
</DEFINITION>
<DEFINITION>
<FOR>Meltdown</FOR>
<GIVEN>PumpFailure</GIVEN>
<GIVEN>WaterLeak</GIVEN>
<TABLE> 0.2 0.8 0.15 0.85 0.1 0.9 0.0010 0.999</TABLE>
</DEFINITION>
</NETWORK>
</BIF>

63
lab4/part1/results.md Normal file
View file

@ -0,0 +1,63 @@
## Some results for pb1 on domain "Shakey"
The problem 1 is not complex enough to have time comparison, but we can observe different strategies.
### IPP algorithm
```
time step 0: MOVE R2 R1
time step 1: PUSH BOX1 R1 R2
time step 2: PUSH BOX1 R2 R3
time step 3: TURN_ON_LIGHT R3 BOX1
time step 4: GRAB SMALL4 R3 LEFT
GRAB SMALL3 R3 RIGHT
time step 5: PUSH BOX1 R3 R2
time step 6: PUSH BOX1 R2 R1
time step 7: RELEASE SMALL3 R1 RIGHT
RELEASE SMALL4 R1 LEFT
time step 8: PUSH BOX1 R1 R2
time step 9: TURN_ON_LIGHT R2 BOX1
time step 10: GRAB SMALL2 R2 RIGHT
time step 11: PUSH BOX1 R2 R1
time step 12: RELEASE SMALL2 R1 RIGHT
Memory used: 0.09 MBytes for domain representation
2.50 MBytes for graph
0.04 MBytes for exclusions
0.04 MBytes for memoization
0.14 MBytes for wave front
```
### FF algorithm
```
step 0: MOVE R2 R1
1: PUSH BOX1 R1 R2
2: TURN_ON_LIGHT R2 BOX1
3: GRAB SMALL2 R2 LEFT
4: MOVE R2 R1
5: RELEASE SMALL2 R1 LEFT
6: MOVE R1 R2
7: PUSH BOX1 R2 R3
8: TURN_ON_LIGHT R3 BOX1
9: GRAB SMALL3 R3 LEFT
10: GRAB SMALL4 R3 RIGHT
11: MOVE R3 R2
12: MOVE R2 R1
13: RELEASE SMALL3 R1 LEFT
14: RELEASE SMALL4 R1 RIGHT
```
### LAMA algorithm
```
(move r2 r1)
(push box1 r1 r2)
(turn_on_light r2 box1)
(grab small2 r2 right)
(move r2 r1)
(release small2 r1 right)
(move r1 r2)
(push box1 r2 r3)
(turn_on_light r3 box1)
(grab small3 r3 left)
(grab small4 r3 right)
(move r3 r2)
(move r2 r1)
(release small3 r1 left)
(release small4 r1 right)
```

View file

@ -0,0 +1,73 @@
;; TDDC17 - Lab 4
;; Shakey's World
;; The objective here is to give a basic
;; domain for the Shakey's World problem.
;; Our domain definition
(define (domain shakey)
;; We only use strips
(:requirements :strips)
(:types
room ;; Represent a room
object ;; Represent any object (small objects or boxes)
gripper ;; Represent Shakey's gripper
)
;; Predicates definition
(:predicates
(position ?r - room) ;; Is Shakey in the given room?
(light ?r - room) ;; Are lights on in the given room?
(connected_wide ?r1 ?r2 - room) ;; Are rooms connected by a wide door?
(connected ?r1 ?r2 - room) ;; Are rooms connected by a door?
(in ?o - object ?r - room) ;; Is the given object in the given room?
(is_empty ?g - gripper) ;; Is the given gripper empty?
(hold_on ?g - gripper ?o - object) ;; Is the given gripper holding the given object?
(is_big ?o - object) ;; Is this object big? I.e. is this object a box?
)
;; Actions definition
;; Robot's actions
(:action move ;; MOVE action, from the room ?pos to ?trg
:parameters (?pos ?trg - room)
:precondition (and (position ?pos)
(connected ?pos ?trg))
:effect (and (not (position ?pos)) (position ?trg))
)
(:action turn_on_light ;; Act of turning on lights. Requires a support.
:parameters (?pos - room ?support - object)
:precondition (and (position ?pos)
(in ?support ?pos)
(is_big ?support)
(not (light ?pos)))
:effect (light ?pos)
)
;; Object actions
(:action grab ;; Action to GRAB sth
:parameters (?what - object ?where - room ?g - gripper)
:precondition (and (position ?where)
(light ?where)
(in ?what ?where)
(is_empty ?g)
(not (is_big ?what)))
:effect (and (not (is_empty ?g))(hold_on ?g ?what)(in ?what ?where))
)
(:action release ;; Action to RELEASE sth
:parameters (?what - object ?where - room ?g - gripper)
:precondition (and (position ?where)
(hold_on ?g ?what))
:effect (and (not (hold_on ?g ?what))(in ?what ?where)(is_empty ?g))
)
(:action push ;; Action to PUSH sth
:parameters (?what - object ?r1 - room ?r2 - room)
:precondition (and (position ?r1)
(is_big ?what)
(in ?what ?r1)
(connected_wide ?r1 ?r2))
:effect (and (position ?r2)(not (position ?r1))(in ?what ?r2)(not(in ?what ?r1)))
)
)

89
lab4/part1/task1_pb1.pddl Normal file
View file

@ -0,0 +1,89 @@
;; TDDC17 - Lab 4
;; S.'s W. problem 1
;; Last modification: 2020-10-04
;; Problem description
;; The first problem has three rooms, connect by doors as discribed below:
;; -------------------------------------------------------------------------
;; | | | |
;; | | | |
;; | light switch 1 -|- light switch2 |- light switch3 |
;; | | | |
;; | --- | door2 |
;; | | | door1 shakey | |
;; | --- (wide) | |
;; | box | | |
;; | | door3 |
;; | | (wide) |
;; | r1 | r2 | r3 |
;; -------------------------------------------------------------------------
;; Shakey must find four small objects distributed in the three rooms and bring
;; them back to the first room. All lights are off initially. The box allowing
;; Shakey to turn on the lights is in the first room.
;; Our problem1 definition
(define (problem pb1)
(:domain shakey)
(:objects
;; Our three rooms
r1 - room
r2 - room
r3 - room
;; The box
box1 - object
;; The four small objects
small1 - object
small2 - object
small3 - object
small4 - object
;; The two Shakey's grippers
right - gripper
left - gripper
)
(:init
;; Init position
;; At the beginning, Shakey is in room 2.
(position r2)
;; Init connections (as discribed above).
(connected_wide r1 r2)
(connected_wide r2 r1)
(connected_wide r2 r3)
(connected_wide r3 r2)
(connected r1 r2)
(connected r2 r1)
(connected r2 r3)
(connected r3 r2)
;; Init object positions
(in box1 r1)
(is_big box1)
(in small1 r1)
(in small2 r2)
(in small3 r3)
(in small4 r3)
;; Init light (light nowhere)
;;(not (light r1))
;;(not (light r2))
;;(not (light r3))
;; Init gripper
(is_empty right)
(is_empty left)
)
;; The goal is to have all four objects in the room 1.
(:goal
(and (in small1 r1)
(in small2 r1)
(in small3 r1)
(in small4 r1))
)
)

68
lab4/part2/domain.pddl Normal file
View file

@ -0,0 +1,68 @@
(define (domain transport-strips)
(:requirements :typing :action-costs)
(:types location fuellevel locatable - object
package truck - locatable
)
(:predicates
(connected ?l1 ?l2 - location)
(at ?o - locatable ?l - location)
(in ?p - package ?t - truck)
(fuel ?t - truck ?level - fuellevel)
(fuelcost ?level - fuellevel ?l1 ?l2 - location)
(sum ?a ?b ?c - fuellevel)
)
(:functions
(total-cost) - number)
(:action LOAD
:parameters
(?p - package
?t - truck
?l - location)
:precondition
(and (at ?t ?l) (at ?p ?l))
:effect
(and (not (at ?p ?l)) (in ?p ?t) (increase (total-cost) 1))
)
(:action UNLOAD
:parameters
(?p - package
?t - truck
?l - location)
:precondition
(and (at ?t ?l) (in ?p ?t))
:effect
(and (at ?p ?l) (not (in ?p ?t)) (increase (total-cost) 1))
)
(:action DRIVE
:parameters
(?t - truck
?l1 - location
?l2 - location
?fuelpost - fuellevel
?fueldelta - fuellevel
?fuelpre - fuellevel)
:precondition
(and
(connected ?l1 ?l2)
(fuelcost ?fueldelta ?l1 ?l2)
(fuel ?t ?fuelpre)
(sum ?fuelpost ?fueldelta ?fuelpre)
(at ?t ?l1)
)
:effect
(and (not (at ?t ?l1))
(at ?t ?l2)
(not (fuel ?t ?fuelpre))
(fuel ?t ?fuelpost)
(increase (total-cost) 1))
)
)

27
lab4/part2/exe.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
# TDDC17
# Script to run all problems with all configurations
echo "Setting up env."
mkdir output
echo -ne "Working in: "
pwd
echo ""
## CONFIG 1: FF heuristic
echo "$i: Running configuration 1 (Eager greedy search, FF heuristic)"
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p02.pddl --log-file output/output-config1FF-pb2 --heuristic 'hff=ff()' --search 'eager_greedy([hff])'
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p03.pddl --log-file output/output-config1FF-pb3 --heuristic 'hff=ff()' --search 'eager_greedy([hff])'
## CONFIG 2: Goal count heristic
echo "$i: Running configuration 2 (Eager greedy search, Goal count heuristic)"
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p02.pddl --log-file output/output-config2GC-pb2 --heuristic 'gc=goalcount()' --search 'eager_greedy([gc])'
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p03.pddl --log-file output/output-config2GC-pb3 --heuristic 'gc=goalcount()' --search 'eager_greedy([gc])'
## CONFIG 3: Goal count heuristic with FF helpful actions
echo "$i: Running configuration 2 (Eager greedy search, goal count heuristic with FF helpful actions)"
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p02.pddl --log-file output/output-config3GF-pb2 --heuristic 'gc=goalcount()' --heuristic 'hff=ff()' --search 'eager_greedy([gc], preferred=[hff], boost=256)'
/courses/TDDC17/sw/fdlog/fast-downward.py domain.pddl p03.pddl --log-file output/output-config3GF-pb3 --heuristic 'gc=goalcount()' --heuristic 'hff=ff()' --search 'eager_greedy([gc], preferred=[hff], boost=256)'
echo "Done."
exit 0

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,699 @@
{"act": "begin_group", "ts": 0}
{"act": "open_list_sorting", "key_list": ["h_SINGLE", "h_(", "h_ff", "h_INSERTION_ORDER", "h_)"]}
{"ts":0, "act": "state_update", "state_id": 0, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "g": -1, "real_g": -1}
{"ts": 0, "act": "evaluated_states", "state_id": 0, "preferred": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 0}
{"ts":0, "act": "state_update", "state_id": 0, "h_ff": 12}
{"ts": 0, "act": "evaluated_heuristics", "count": 1}
{"act": "preferred_heuristics", "key_list": []}
{"act": "main_heuristic", "target": "h_ff"}
{"act": "end_group"}
{"act": "begin_group", "ts": 1}
{"ts":1, "act": "state_update", "state_id": 0, "g": 0, "real_g": 0}
{"ts": 1, "act": "expanded_states", "state_id": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 1}
{"ts":1, "act": "state_update", "state_id": 1, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [0, "move r2 r1", 1]}
{"ts": 1, "act": "generated_states", "state_id": 0, "op": "move r2 r1"}
{"ts":1, "act": "state_update", "state_id": 1, "g": -1, "real_g": -1}
{"ts": 1, "act": "evaluated_states", "state_id": 1, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 1}
{"ts":1, "act": "state_update", "state_id": 1, "h_ff": 12}
{"ts": 1, "act": "evaluated_heuristics", "count": 1}
{"ts":1, "act": "state_update", "state_id": 2, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [0, "move r2 r3", 1]}
{"ts": 1, "act": "generated_states", "state_id": 0, "op": "move r2 r3"}
{"ts":1, "act": "state_update", "state_id": 2, "g": -1, "real_g": -1}
{"ts": 1, "act": "evaluated_states", "state_id": 2, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 1}
{"ts":1, "act": "state_update", "state_id": 2, "h_ff": 12}
{"ts": 1, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 2}
{"ts":2, "act": "state_update", "state_id": 1, "g": 1, "real_g": 1}
{"ts": 2, "act": "expanded_states", "state_id": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 2}
{"ts":2, "act": "state_update", "state_id": 3, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [1, "push box1 r1 r2", 1]}
{"ts": 2, "act": "generated_states", "state_id": 1, "op": "push box1 r1 r2"}
{"ts":2, "act": "state_update", "state_id": 3, "g": -1, "real_g": -1}
{"ts": 2, "act": "evaluated_states", "state_id": 3, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 2}
{"ts":2, "act": "state_update", "state_id": 3, "h_ff": 11}
{"ts": 2, "act": "evaluated_heuristics", "count": 1}
{"ts":2, "act": "state_update", "state_id": 4, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "0(Atom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [1, "turn_on_light r1 box1", 1]}
{"ts": 2, "act": "generated_states", "state_id": 1, "op": "turn_on_light r1 box1"}
{"ts":2, "act": "state_update", "state_id": 4, "g": -1, "real_g": -1}
{"ts": 2, "act": "evaluated_states", "state_id": 4, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 2}
{"ts":2, "act": "state_update", "state_id": 4, "h_ff": 12}
{"ts": 2, "act": "evaluated_heuristics", "count": 1}
{"ts":2, "act": "state_update", "state_id": 0, "new_parent": [1, "move r1 r2", 1]}
{"ts": 2, "act": "generated_states", "state_id": 1, "op": "move r1 r2"}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 3, "g": 2, "real_g": 2}
{"ts": 3, "act": "expanded_states", "state_id": 3}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 5, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [3, "move r2 r1", 1]}
{"ts": 3, "act": "generated_states", "state_id": 3, "op": "move r2 r1"}
{"ts":3, "act": "state_update", "state_id": 5, "g": -1, "real_g": -1}
{"ts": 3, "act": "evaluated_states", "state_id": 5, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 5, "h_ff": 11}
{"ts": 3, "act": "evaluated_heuristics", "count": 1}
{"ts":3, "act": "state_update", "state_id": 6, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [3, "move r2 r3", 1]}
{"ts": 3, "act": "generated_states", "state_id": 3, "op": "move r2 r3"}
{"ts":3, "act": "state_update", "state_id": 6, "g": -1, "real_g": -1}
{"ts": 3, "act": "evaluated_states", "state_id": 6, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 6, "h_ff": 11}
{"ts": 3, "act": "evaluated_heuristics", "count": 1}
{"ts":3, "act": "state_update", "state_id": 1, "new_parent": [3, "push box1 r2 r1", 1]}
{"ts": 3, "act": "generated_states", "state_id": 3, "op": "push box1 r2 r1"}
{"ts":3, "act": "state_update", "state_id": 7, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "1(NegatedAtom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [3, "push box1 r2 r3", 1]}
{"ts": 3, "act": "generated_states", "state_id": 3, "op": "push box1 r2 r3"}
{"ts":3, "act": "state_update", "state_id": 7, "g": -1, "real_g": -1}
{"ts": 3, "act": "evaluated_states", "state_id": 7, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 7, "h_ff": 11}
{"ts": 3, "act": "evaluated_heuristics", "count": 1}
{"ts":3, "act": "state_update", "state_id": 8, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [3, "turn_on_light r2 box1", 1]}
{"ts": 3, "act": "generated_states", "state_id": 3, "op": "turn_on_light r2 box1"}
{"ts":3, "act": "state_update", "state_id": 8, "g": -1, "real_g": -1}
{"ts": 3, "act": "evaluated_states", "state_id": 8, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 3}
{"ts":3, "act": "state_update", "state_id": 8, "h_ff": 10}
{"ts": 3, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 8, "g": 3, "real_g": 3}
{"ts": 4, "act": "expanded_states", "state_id": 8}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 9, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "move r2 r1", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "move r2 r1"}
{"ts":4, "act": "state_update", "state_id": 9, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 9, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 9, "h_ff": 10}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"ts":4, "act": "state_update", "state_id": 10, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "move r2 r3", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "move r2 r3"}
{"ts":4, "act": "state_update", "state_id": 10, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 10, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 10, "h_ff": 10}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"ts":4, "act": "state_update", "state_id": 11, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "push box1 r2 r1", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "push box1 r2 r1"}
{"ts":4, "act": "state_update", "state_id": 11, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 11, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 11, "h_ff": 11}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"ts":4, "act": "state_update", "state_id": 12, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "push box1 r2 r3", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "push box1 r2 r3"}
{"ts":4, "act": "state_update", "state_id": 12, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 12, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 12, "h_ff": 9}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"ts":4, "act": "state_update", "state_id": 13, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "grab small2 r2 left", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "grab small2 r2 left"}
{"ts":4, "act": "state_update", "state_id": 13, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 13, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 13, "h_ff": 9}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"ts":4, "act": "state_update", "state_id": 14, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "1(Atom hold_on(right, small2))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [8, "grab small2 r2 right", 1]}
{"ts": 4, "act": "generated_states", "state_id": 8, "op": "grab small2 r2 right"}
{"ts":4, "act": "state_update", "state_id": 14, "g": -1, "real_g": -1}
{"ts": 4, "act": "evaluated_states", "state_id": 14, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 4}
{"ts":4, "act": "state_update", "state_id": 14, "h_ff": 9}
{"ts": 4, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 5}
{"ts":5, "act": "state_update", "state_id": 12, "g": 4, "real_g": 4}
{"ts": 5, "act": "expanded_states", "state_id": 12}
{"act": "end_group"}
{"act": "begin_group", "ts": 5}
{"ts":5, "act": "state_update", "state_id": 8, "new_parent": [12, "push box1 r3 r2", 1]}
{"ts": 5, "act": "generated_states", "state_id": 12, "op": "push box1 r3 r2"}
{"ts":5, "act": "state_update", "state_id": 15, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [12, "turn_on_light r3 box1", 1]}
{"ts": 5, "act": "generated_states", "state_id": 12, "op": "turn_on_light r3 box1"}
{"ts":5, "act": "state_update", "state_id": 15, "g": -1, "real_g": -1}
{"ts": 5, "act": "evaluated_states", "state_id": 15, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 5}
{"ts":5, "act": "state_update", "state_id": 15, "h_ff": 8}
{"ts": 5, "act": "evaluated_heuristics", "count": 1}
{"ts":5, "act": "state_update", "state_id": 16, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "1(NegatedAtom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [12, "move r3 r2", 1]}
{"ts": 5, "act": "generated_states", "state_id": 12, "op": "move r3 r2"}
{"ts":5, "act": "state_update", "state_id": 16, "g": -1, "real_g": -1}
{"ts": 5, "act": "evaluated_states", "state_id": 16, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 5}
{"ts":5, "act": "state_update", "state_id": 16, "h_ff": 9}
{"ts": 5, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 15, "g": 5, "real_g": 5}
{"ts": 6, "act": "expanded_states", "state_id": 15}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 17, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "push box1 r3 r2", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "push box1 r3 r2"}
{"ts":6, "act": "state_update", "state_id": 17, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 17, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 17, "h_ff": 8}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"ts":6, "act": "state_update", "state_id": 18, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "move r3 r2", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "move r3 r2"}
{"ts":6, "act": "state_update", "state_id": 18, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 18, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 18, "h_ff": 8}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"ts":6, "act": "state_update", "state_id": 19, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "grab small3 r3 left", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "grab small3 r3 left"}
{"ts":6, "act": "state_update", "state_id": 19, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 19, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 19, "h_ff": 7}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"ts":6, "act": "state_update", "state_id": 20, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "3(Atom hold_on(left, small4))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "grab small4 r3 left", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "grab small4 r3 left"}
{"ts":6, "act": "state_update", "state_id": 20, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 20, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 20, "h_ff": 7}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"ts":6, "act": "state_update", "state_id": 21, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "2(Atom hold_on(right, small3))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "grab small3 r3 right", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "grab small3 r3 right"}
{"ts":6, "act": "state_update", "state_id": 21, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 21, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 21, "h_ff": 7}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"ts":6, "act": "state_update", "state_id": 22, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [15, "grab small4 r3 right", 1]}
{"ts": 6, "act": "generated_states", "state_id": 15, "op": "grab small4 r3 right"}
{"ts":6, "act": "state_update", "state_id": 22, "g": -1, "real_g": -1}
{"ts": 6, "act": "evaluated_states", "state_id": 22, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 6}
{"ts":6, "act": "state_update", "state_id": 22, "h_ff": 7}
{"ts": 6, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 19, "g": 6, "real_g": 6}
{"ts": 7, "act": "expanded_states", "state_id": 19}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 23, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [19, "push box1 r3 r2", 1]}
{"ts": 7, "act": "generated_states", "state_id": 19, "op": "push box1 r3 r2"}
{"ts":7, "act": "state_update", "state_id": 23, "g": -1, "real_g": -1}
{"ts": 7, "act": "evaluated_states", "state_id": 23, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 23, "h_ff": 7}
{"ts": 7, "act": "evaluated_heuristics", "count": 1}
{"ts":7, "act": "state_update", "state_id": 24, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [19, "move r3 r2", 1]}
{"ts": 7, "act": "generated_states", "state_id": 19, "op": "move r3 r2"}
{"ts":7, "act": "state_update", "state_id": 24, "g": -1, "real_g": -1}
{"ts": 7, "act": "evaluated_states", "state_id": 24, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 24, "h_ff": 7}
{"ts": 7, "act": "evaluated_heuristics", "count": 1}
{"ts":7, "act": "state_update", "state_id": 25, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "2(Atom hold_on(right, small3))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [19, "grab small3 r3 right", 1]}
{"ts": 7, "act": "generated_states", "state_id": 19, "op": "grab small3 r3 right"}
{"ts":7, "act": "state_update", "state_id": 25, "g": -1, "real_g": -1}
{"ts": 7, "act": "evaluated_states", "state_id": 25, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 25, "h_ff": 9}
{"ts": 7, "act": "evaluated_heuristics", "count": 1}
{"ts":7, "act": "state_update", "state_id": 26, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [19, "grab small4 r3 right", 1]}
{"ts": 7, "act": "generated_states", "state_id": 19, "op": "grab small4 r3 right"}
{"ts":7, "act": "state_update", "state_id": 26, "g": -1, "real_g": -1}
{"ts": 7, "act": "evaluated_states", "state_id": 26, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 7}
{"ts":7, "act": "state_update", "state_id": 26, "h_ff": 7}
{"ts": 7, "act": "evaluated_heuristics", "count": 1}
{"ts":7, "act": "state_update", "state_id": 15, "new_parent": [19, "release small3 r3 left", 1]}
{"ts": 7, "act": "generated_states", "state_id": 19, "op": "release small3 r3 left"}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 20, "g": 6, "real_g": 6}
{"ts": 8, "act": "expanded_states", "state_id": 20}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 27, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "3(Atom hold_on(left, small4))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [20, "push box1 r3 r2", 1]}
{"ts": 8, "act": "generated_states", "state_id": 20, "op": "push box1 r3 r2"}
{"ts":8, "act": "state_update", "state_id": 27, "g": -1, "real_g": -1}
{"ts": 8, "act": "evaluated_states", "state_id": 27, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 27, "h_ff": 7}
{"ts": 8, "act": "evaluated_heuristics", "count": 1}
{"ts":8, "act": "state_update", "state_id": 28, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "3(Atom hold_on(left, small4))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [20, "move r3 r2", 1]}
{"ts": 8, "act": "generated_states", "state_id": 20, "op": "move r3 r2"}
{"ts":8, "act": "state_update", "state_id": 28, "g": -1, "real_g": -1}
{"ts": 8, "act": "evaluated_states", "state_id": 28, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 28, "h_ff": 7}
{"ts": 8, "act": "evaluated_heuristics", "count": 1}
{"ts":8, "act": "state_update", "state_id": 29, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "3(Atom hold_on(left, small4))", "var13": "2(Atom hold_on(right, small3))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [20, "grab small3 r3 right", 1]}
{"ts": 8, "act": "generated_states", "state_id": 20, "op": "grab small3 r3 right"}
{"ts":8, "act": "state_update", "state_id": 29, "g": -1, "real_g": -1}
{"ts": 8, "act": "evaluated_states", "state_id": 29, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 29, "h_ff": 7}
{"ts": 8, "act": "evaluated_heuristics", "count": 1}
{"ts":8, "act": "state_update", "state_id": 30, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "3(Atom hold_on(left, small4))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [20, "grab small4 r3 right", 1]}
{"ts": 8, "act": "generated_states", "state_id": 20, "op": "grab small4 r3 right"}
{"ts":8, "act": "state_update", "state_id": 30, "g": -1, "real_g": -1}
{"ts": 8, "act": "evaluated_states", "state_id": 30, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 8}
{"ts":8, "act": "state_update", "state_id": 30, "h_ff": 9}
{"ts": 8, "act": "evaluated_heuristics", "count": 1}
{"ts":8, "act": "state_update", "state_id": 15, "new_parent": [20, "release small4 r3 left", 1]}
{"ts": 8, "act": "generated_states", "state_id": 20, "op": "release small4 r3 left"}
{"act": "end_group"}
{"act": "begin_group", "ts": 9}
{"ts":9, "act": "state_update", "state_id": 21, "g": 6, "real_g": 6}
{"ts": 9, "act": "expanded_states", "state_id": 21}
{"act": "end_group"}
{"act": "begin_group", "ts": 9}
{"ts":9, "act": "state_update", "state_id": 31, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "2(Atom hold_on(right, small3))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [21, "push box1 r3 r2", 1]}
{"ts": 9, "act": "generated_states", "state_id": 21, "op": "push box1 r3 r2"}
{"ts":9, "act": "state_update", "state_id": 31, "g": -1, "real_g": -1}
{"ts": 9, "act": "evaluated_states", "state_id": 31, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 9}
{"ts":9, "act": "state_update", "state_id": 31, "h_ff": 7}
{"ts": 9, "act": "evaluated_heuristics", "count": 1}
{"ts":9, "act": "state_update", "state_id": 32, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "2(Atom hold_on(right, small3))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [21, "move r3 r2", 1]}
{"ts": 9, "act": "generated_states", "state_id": 21, "op": "move r3 r2"}
{"ts":9, "act": "state_update", "state_id": 32, "g": -1, "real_g": -1}
{"ts": 9, "act": "evaluated_states", "state_id": 32, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 9}
{"ts":9, "act": "state_update", "state_id": 32, "h_ff": 7}
{"ts": 9, "act": "evaluated_heuristics", "count": 1}
{"ts":9, "act": "state_update", "state_id": 25, "new_parent": [21, "grab small3 r3 left", 1]}
{"ts": 9, "act": "generated_states", "state_id": 21, "op": "grab small3 r3 left"}
{"ts":9, "act": "state_update", "state_id": 25, "g": 7, "real_g": 7}
{"ts":9, "act": "state_update", "state_id": 29, "new_parent": [21, "grab small4 r3 left", 1]}
{"ts": 9, "act": "generated_states", "state_id": 21, "op": "grab small4 r3 left"}
{"ts":9, "act": "state_update", "state_id": 29, "g": 7, "real_g": 7}
{"ts":9, "act": "state_update", "state_id": 15, "new_parent": [21, "release small3 r3 right", 1]}
{"ts": 9, "act": "generated_states", "state_id": 21, "op": "release small3 r3 right"}
{"act": "end_group"}
{"act": "begin_group", "ts": 10}
{"ts":10, "act": "state_update", "state_id": 22, "g": 6, "real_g": 6}
{"ts": 10, "act": "expanded_states", "state_id": 22}
{"act": "end_group"}
{"act": "begin_group", "ts": 10}
{"ts":10, "act": "state_update", "state_id": 33, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [22, "push box1 r3 r2", 1]}
{"ts": 10, "act": "generated_states", "state_id": 22, "op": "push box1 r3 r2"}
{"ts":10, "act": "state_update", "state_id": 33, "g": -1, "real_g": -1}
{"ts": 10, "act": "evaluated_states", "state_id": 33, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 10}
{"ts":10, "act": "state_update", "state_id": 33, "h_ff": 7}
{"ts": 10, "act": "evaluated_heuristics", "count": 1}
{"ts":10, "act": "state_update", "state_id": 34, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [22, "move r3 r2", 1]}
{"ts": 10, "act": "generated_states", "state_id": 22, "op": "move r3 r2"}
{"ts":10, "act": "state_update", "state_id": 34, "g": -1, "real_g": -1}
{"ts": 10, "act": "evaluated_states", "state_id": 34, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 10}
{"ts":10, "act": "state_update", "state_id": 34, "h_ff": 7}
{"ts": 10, "act": "evaluated_heuristics", "count": 1}
{"ts":10, "act": "state_update", "state_id": 26, "new_parent": [22, "grab small3 r3 left", 1]}
{"ts": 10, "act": "generated_states", "state_id": 22, "op": "grab small3 r3 left"}
{"ts":10, "act": "state_update", "state_id": 26, "g": 7, "real_g": 7}
{"ts":10, "act": "state_update", "state_id": 30, "new_parent": [22, "grab small4 r3 left", 1]}
{"ts": 10, "act": "generated_states", "state_id": 22, "op": "grab small4 r3 left"}
{"ts":10, "act": "state_update", "state_id": 30, "g": 7, "real_g": 7}
{"ts":10, "act": "state_update", "state_id": 15, "new_parent": [22, "release small4 r3 right", 1]}
{"ts": 10, "act": "generated_states", "state_id": 22, "op": "release small4 r3 right"}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 23, "g": 7, "real_g": 7}
{"ts": 11, "act": "expanded_states", "state_id": 23}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 35, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [23, "move r2 r1", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "move r2 r1"}
{"ts":11, "act": "state_update", "state_id": 35, "g": -1, "real_g": -1}
{"ts": 11, "act": "evaluated_states", "state_id": 35, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 35, "h_ff": 7}
{"ts": 11, "act": "evaluated_heuristics", "count": 1}
{"ts":11, "act": "state_update", "state_id": 36, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [23, "move r2 r3", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "move r2 r3"}
{"ts":11, "act": "state_update", "state_id": 36, "g": -1, "real_g": -1}
{"ts": 11, "act": "evaluated_states", "state_id": 36, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 36, "h_ff": 7}
{"ts": 11, "act": "evaluated_heuristics", "count": 1}
{"ts":11, "act": "state_update", "state_id": 37, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [23, "push box1 r2 r1", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "push box1 r2 r1"}
{"ts":11, "act": "state_update", "state_id": 37, "g": -1, "real_g": -1}
{"ts": 11, "act": "evaluated_states", "state_id": 37, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 37, "h_ff": 7}
{"ts": 11, "act": "evaluated_heuristics", "count": 1}
{"ts":11, "act": "state_update", "state_id": 19, "new_parent": [23, "push box1 r2 r3", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "push box1 r2 r3"}
{"ts":11, "act": "state_update", "state_id": 38, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "1(Atom hold_on(right, small2))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [23, "grab small2 r2 right", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "grab small2 r2 right"}
{"ts":11, "act": "state_update", "state_id": 38, "g": -1, "real_g": -1}
{"ts": 11, "act": "evaluated_states", "state_id": 38, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 38, "h_ff": 7}
{"ts": 11, "act": "evaluated_heuristics", "count": 1}
{"ts":11, "act": "state_update", "state_id": 39, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "0(Atom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [23, "release small3 r2 left", 1]}
{"ts": 11, "act": "generated_states", "state_id": 23, "op": "release small3 r2 left"}
{"ts":11, "act": "state_update", "state_id": 39, "g": -1, "real_g": -1}
{"ts": 11, "act": "evaluated_states", "state_id": 39, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 11}
{"ts":11, "act": "state_update", "state_id": 39, "h_ff": 8}
{"ts": 11, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 12}
{"ts":12, "act": "state_update", "state_id": 24, "g": 7, "real_g": 7}
{"ts": 12, "act": "expanded_states", "state_id": 24}
{"act": "end_group"}
{"act": "begin_group", "ts": 12}
{"ts":12, "act": "state_update", "state_id": 40, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [24, "move r2 r1", 1]}
{"ts": 12, "act": "generated_states", "state_id": 24, "op": "move r2 r1"}
{"ts":12, "act": "state_update", "state_id": 40, "g": -1, "real_g": -1}
{"ts": 12, "act": "evaluated_states", "state_id": 40, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 12}
{"ts":12, "act": "state_update", "state_id": 40, "h_ff": 7}
{"ts": 12, "act": "evaluated_heuristics", "count": 1}
{"ts":12, "act": "state_update", "state_id": 19, "new_parent": [24, "move r2 r3", 1]}
{"ts": 12, "act": "generated_states", "state_id": 24, "op": "move r2 r3"}
{"ts":12, "act": "state_update", "state_id": 41, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "1(Atom hold_on(right, small2))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [24, "grab small2 r2 right", 1]}
{"ts": 12, "act": "generated_states", "state_id": 24, "op": "grab small2 r2 right"}
{"ts":12, "act": "state_update", "state_id": 41, "g": -1, "real_g": -1}
{"ts": 12, "act": "evaluated_states", "state_id": 41, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 12}
{"ts":12, "act": "state_update", "state_id": 41, "h_ff": 7}
{"ts": 12, "act": "evaluated_heuristics", "count": 1}
{"ts":12, "act": "state_update", "state_id": 42, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "0(Atom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [24, "release small3 r2 left", 1]}
{"ts": 12, "act": "generated_states", "state_id": 24, "op": "release small3 r2 left"}
{"ts":12, "act": "state_update", "state_id": 42, "g": -1, "real_g": -1}
{"ts": 12, "act": "evaluated_states", "state_id": 42, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 12}
{"ts":12, "act": "state_update", "state_id": 42, "h_ff": 8}
{"ts": 12, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 13}
{"ts": 13, "act": "expanded_states", "state_id": 26}
{"act": "end_group"}
{"act": "begin_group", "ts": 13}
{"ts":13, "act": "state_update", "state_id": 43, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [26, "push box1 r3 r2", 1]}
{"ts": 13, "act": "generated_states", "state_id": 26, "op": "push box1 r3 r2"}
{"ts":13, "act": "state_update", "state_id": 43, "g": -1, "real_g": -1}
{"ts": 13, "act": "evaluated_states", "state_id": 43, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 13}
{"ts":13, "act": "state_update", "state_id": 43, "h_ff": 6}
{"ts": 13, "act": "evaluated_heuristics", "count": 1}
{"ts":13, "act": "state_update", "state_id": 44, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [26, "move r3 r2", 1]}
{"ts": 13, "act": "generated_states", "state_id": 26, "op": "move r3 r2"}
{"ts":13, "act": "state_update", "state_id": 44, "g": -1, "real_g": -1}
{"ts": 13, "act": "evaluated_states", "state_id": 44, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 13}
{"ts":13, "act": "state_update", "state_id": 44, "h_ff": 6}
{"ts": 13, "act": "evaluated_heuristics", "count": 1}
{"ts":13, "act": "state_update", "state_id": 22, "new_parent": [26, "release small3 r3 left", 1]}
{"ts": 13, "act": "generated_states", "state_id": 26, "op": "release small3 r3 left"}
{"ts":13, "act": "state_update", "state_id": 19, "new_parent": [26, "release small4 r3 right", 1]}
{"ts": 13, "act": "generated_states", "state_id": 26, "op": "release small4 r3 right"}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 43, "g": 8, "real_g": 8}
{"ts": 14, "act": "expanded_states", "state_id": 43}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 45, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [43, "move r2 r1", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "move r2 r1"}
{"ts":14, "act": "state_update", "state_id": 45, "g": -1, "real_g": -1}
{"ts": 14, "act": "evaluated_states", "state_id": 45, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 45, "h_ff": 5}
{"ts": 14, "act": "evaluated_heuristics", "count": 1}
{"ts":14, "act": "state_update", "state_id": 46, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [43, "move r2 r3", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "move r2 r3"}
{"ts":14, "act": "state_update", "state_id": 46, "g": -1, "real_g": -1}
{"ts": 14, "act": "evaluated_states", "state_id": 46, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 46, "h_ff": 7}
{"ts": 14, "act": "evaluated_heuristics", "count": 1}
{"ts":14, "act": "state_update", "state_id": 47, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [43, "push box1 r2 r1", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "push box1 r2 r1"}
{"ts":14, "act": "state_update", "state_id": 47, "g": -1, "real_g": -1}
{"ts": 14, "act": "evaluated_states", "state_id": 47, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 47, "h_ff": 5}
{"ts": 14, "act": "evaluated_heuristics", "count": 1}
{"ts":14, "act": "state_update", "state_id": 26, "new_parent": [43, "push box1 r2 r3", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "push box1 r2 r3"}
{"ts":14, "act": "state_update", "state_id": 48, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "0(Atom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [43, "release small3 r2 left", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "release small3 r2 left"}
{"ts":14, "act": "state_update", "state_id": 48, "g": -1, "real_g": -1}
{"ts": 14, "act": "evaluated_states", "state_id": 48, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 48, "h_ff": 6}
{"ts": 14, "act": "evaluated_heuristics", "count": 1}
{"ts":14, "act": "state_update", "state_id": 49, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "0(Atom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [43, "release small4 r2 right", 1]}
{"ts": 14, "act": "generated_states", "state_id": 43, "op": "release small4 r2 right"}
{"ts":14, "act": "state_update", "state_id": 49, "g": -1, "real_g": -1}
{"ts": 14, "act": "evaluated_states", "state_id": 49, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 14}
{"ts":14, "act": "state_update", "state_id": 49, "h_ff": 6}
{"ts": 14, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 15}
{"ts":15, "act": "state_update", "state_id": 45, "g": 9, "real_g": 9}
{"ts": 15, "act": "expanded_states", "state_id": 45}
{"act": "end_group"}
{"act": "begin_group", "ts": 15}
{"ts":15, "act": "state_update", "state_id": 43, "new_parent": [45, "move r1 r2", 1]}
{"ts": 15, "act": "generated_states", "state_id": 45, "op": "move r1 r2"}
{"ts":15, "act": "state_update", "state_id": 50, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [45, "release small3 r1 left", 1]}
{"ts": 15, "act": "generated_states", "state_id": 45, "op": "release small3 r1 left"}
{"ts":15, "act": "state_update", "state_id": 50, "g": -1, "real_g": -1}
{"ts": 15, "act": "evaluated_states", "state_id": 50, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 15}
{"ts":15, "act": "state_update", "state_id": 50, "h_ff": 4}
{"ts": 15, "act": "evaluated_heuristics", "count": 1}
{"ts":15, "act": "state_update", "state_id": 51, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "2(Atom hold_on(left, small3))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "1(NegatedAtom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [45, "release small4 r1 right", 1]}
{"ts": 15, "act": "generated_states", "state_id": 45, "op": "release small4 r1 right"}
{"ts":15, "act": "state_update", "state_id": 51, "g": -1, "real_g": -1}
{"ts": 15, "act": "evaluated_states", "state_id": 51, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 15}
{"ts":15, "act": "state_update", "state_id": 51, "h_ff": 4}
{"ts": 15, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 16}
{"ts":16, "act": "state_update", "state_id": 50, "g": 10, "real_g": 10}
{"ts": 16, "act": "expanded_states", "state_id": 50}
{"act": "end_group"}
{"act": "begin_group", "ts": 16}
{"ts":16, "act": "state_update", "state_id": 52, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "3(Atom hold_on(right, small4))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "1(NegatedAtom in(small4, r1))"}, "new_parent": [50, "move r1 r2", 1]}
{"ts": 16, "act": "generated_states", "state_id": 50, "op": "move r1 r2"}
{"ts":16, "act": "state_update", "state_id": 52, "g": -1, "real_g": -1}
{"ts": 16, "act": "evaluated_states", "state_id": 52, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 16}
{"ts":16, "act": "state_update", "state_id": 52, "h_ff": 4}
{"ts": 16, "act": "evaluated_heuristics", "count": 1}
{"ts":16, "act": "state_update", "state_id": 53, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [50, "release small4 r1 right", 1]}
{"ts": 16, "act": "generated_states", "state_id": 50, "op": "release small4 r1 right"}
{"ts":16, "act": "state_update", "state_id": 53, "g": -1, "real_g": -1}
{"ts": 16, "act": "evaluated_states", "state_id": 53, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 16}
{"ts":16, "act": "state_update", "state_id": 53, "h_ff": 3}
{"ts": 16, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 17}
{"ts":17, "act": "state_update", "state_id": 53, "g": 11, "real_g": 11}
{"ts": 17, "act": "expanded_states", "state_id": 53}
{"act": "end_group"}
{"act": "begin_group", "ts": 17}
{"ts":17, "act": "state_update", "state_id": 54, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [53, "move r1 r2", 1]}
{"ts": 17, "act": "generated_states", "state_id": 53, "op": "move r1 r2"}
{"ts":17, "act": "state_update", "state_id": 54, "g": -1, "real_g": -1}
{"ts": 17, "act": "evaluated_states", "state_id": 54, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 17}
{"ts":17, "act": "state_update", "state_id": 54, "h_ff": 3}
{"ts": 17, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 54, "g": 12, "real_g": 12}
{"ts": 18, "act": "expanded_states", "state_id": 54}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 53, "new_parent": [54, "move r2 r1", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "move r2 r1"}
{"ts":18, "act": "state_update", "state_id": 55, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [54, "move r2 r3", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "move r2 r3"}
{"ts":18, "act": "state_update", "state_id": 55, "g": -1, "real_g": -1}
{"ts": 18, "act": "evaluated_states", "state_id": 55, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 55, "h_ff": 4}
{"ts": 18, "act": "evaluated_heuristics", "count": 1}
{"ts":18, "act": "state_update", "state_id": 56, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [54, "push box1 r2 r1", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "push box1 r2 r1"}
{"ts":18, "act": "state_update", "state_id": 56, "g": -1, "real_g": -1}
{"ts": 18, "act": "evaluated_states", "state_id": 56, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 56, "h_ff": 3}
{"ts": 18, "act": "evaluated_heuristics", "count": 1}
{"ts":18, "act": "state_update", "state_id": 57, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [54, "push box1 r2 r3", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "push box1 r2 r3"}
{"ts":18, "act": "state_update", "state_id": 57, "g": -1, "real_g": -1}
{"ts": 18, "act": "evaluated_states", "state_id": 57, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 57, "h_ff": 4}
{"ts": 18, "act": "evaluated_heuristics", "count": 1}
{"ts":18, "act": "state_update", "state_id": 58, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [54, "grab small2 r2 left", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "grab small2 r2 left"}
{"ts":18, "act": "state_update", "state_id": 58, "g": -1, "real_g": -1}
{"ts": 18, "act": "evaluated_states", "state_id": 58, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 58, "h_ff": 2}
{"ts": 18, "act": "evaluated_heuristics", "count": 1}
{"ts":18, "act": "state_update", "state_id": 59, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "1(Atom hold_on(right, small2))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [54, "grab small2 r2 right", 1]}
{"ts": 18, "act": "generated_states", "state_id": 54, "op": "grab small2 r2 right"}
{"ts":18, "act": "state_update", "state_id": 59, "g": -1, "real_g": -1}
{"ts": 18, "act": "evaluated_states", "state_id": 59, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 18}
{"ts":18, "act": "state_update", "state_id": 59, "h_ff": 2}
{"ts": 18, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 58, "g": 13, "real_g": 13}
{"ts": 19, "act": "expanded_states", "state_id": 58}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 60, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [58, "move r2 r1", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "move r2 r1"}
{"ts":19, "act": "state_update", "state_id": 60, "g": -1, "real_g": -1}
{"ts": 19, "act": "evaluated_states", "state_id": 60, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 60, "h_ff": 1}
{"ts": 19, "act": "evaluated_heuristics", "count": 1}
{"ts":19, "act": "state_update", "state_id": 61, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [58, "move r2 r3", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "move r2 r3"}
{"ts":19, "act": "state_update", "state_id": 61, "g": -1, "real_g": -1}
{"ts": 19, "act": "evaluated_states", "state_id": 61, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 61, "h_ff": 3}
{"ts": 19, "act": "evaluated_heuristics", "count": 1}
{"ts":19, "act": "state_update", "state_id": 62, "state": {"var0": "0(Atom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [58, "push box1 r2 r1", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "push box1 r2 r1"}
{"ts":19, "act": "state_update", "state_id": 62, "g": -1, "real_g": -1}
{"ts": 19, "act": "evaluated_states", "state_id": 62, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 62, "h_ff": 1}
{"ts": 19, "act": "evaluated_heuristics", "count": 1}
{"ts":19, "act": "state_update", "state_id": 63, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "0(Atom in(box1, r3))", "var2": "2(Atom position(r3))", "var3": "1(NegatedAtom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "4(Atom is_empty(right))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [58, "push box1 r2 r3", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "push box1 r2 r3"}
{"ts":19, "act": "state_update", "state_id": 63, "g": -1, "real_g": -1}
{"ts": 19, "act": "evaluated_states", "state_id": 63, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 63, "h_ff": 3}
{"ts": 19, "act": "evaluated_heuristics", "count": 1}
{"ts":19, "act": "state_update", "state_id": 64, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "1(Atom position(r2))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "1(Atom hold_on(left, small2))", "var13": "1(Atom hold_on(right, small2))", "var14": "1(NegatedAtom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [58, "grab small2 r2 right", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "grab small2 r2 right"}
{"ts":19, "act": "state_update", "state_id": 64, "g": -1, "real_g": -1}
{"ts": 19, "act": "evaluated_states", "state_id": 64, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 19}
{"ts":19, "act": "state_update", "state_id": 64, "h_ff": 2}
{"ts": 19, "act": "evaluated_heuristics", "count": 1}
{"ts":19, "act": "state_update", "state_id": 54, "new_parent": [58, "release small2 r2 left", 1]}
{"ts": 19, "act": "generated_states", "state_id": 58, "op": "release small2 r2 left"}
{"act": "end_group"}
{"act": "begin_group", "ts": 20}
{"ts":20, "act": "state_update", "state_id": 60, "g": 14, "real_g": 14}
{"ts": 20, "act": "expanded_states", "state_id": 60}
{"act": "end_group"}
{"act": "begin_group", "ts": 20}
{"ts":20, "act": "state_update", "state_id": 58, "new_parent": [60, "move r1 r2", 1]}
{"ts": 20, "act": "generated_states", "state_id": 60, "op": "move r1 r2"}
{"ts":20, "act": "state_update", "state_id": 65, "state": {"var0": "1(NegatedAtom in(box1, r1))", "var1": "1(NegatedAtom in(box1, r3))", "var2": "0(Atom position(r1))", "var3": "0(Atom in(box1, r2))", "var4": "0(Atom light(r2))", "var5": "1(NegatedAtom light(r1))", "var6": "0(Atom light(r3))", "var7": "1(NegatedAtom in(small1, r2))", "var8": "1(NegatedAtom in(small1, r3))", "var9": "1(NegatedAtom in(small2, r3))", "var10": "1(NegatedAtom in(small3, r2))", "var11": "1(NegatedAtom in(small4, r2))", "var12": "4(Atom is_empty(left))", "var13": "4(Atom is_empty(right))", "var14": "0(Atom in(small2, r1))", "var15": "0(Atom in(small3, r1))", "var16": "0(Atom in(small4, r1))"}, "new_parent": [60, "release small2 r1 left", 1]}
{"ts": 20, "act": "generated_states", "state_id": 60, "op": "release small2 r1 left"}
{"ts":20, "act": "state_update", "state_id": 65, "g": -1, "real_g": -1}
{"ts": 20, "act": "evaluated_states", "state_id": 65, "preferred": 0}
{"act": "end_group"}
{"act": "begin_group", "ts": 20}
{"ts":20, "act": "state_update", "state_id": 65, "h_ff": 0}
{"ts": 20, "act": "evaluated_heuristics", "count": 1}
{"act": "end_group"}
{"act": "begin_group", "ts": 21}
{"ts":21, "act": "state_update", "state_id": 65, "g": 15, "real_g": 15}
{"ts": 21, "act": "expanded_states", "state_id": 65}
{"act": "end_group"}
{"ts": 21, "act": "plan_found", "state_ids": [0, 1, 3, 8, 12, 15, 19, 26, 43, 45, 50, 53, 54, 58, 60, 65]}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

5128
lab4/part2/p02.pddl Normal file

File diff suppressed because it is too large Load diff

16559
lab4/part2/p03.pddl Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,308 @@
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Random;
// TDDC17 - Lab 5
// Part 2: Q Learning Controller
// Last modification: 2020-10-06
/* GUI commands :
* M : disable GUI, much faster
* E : toggle exploration
* V : Speed up learning
* P : turn off controller
* O : turn on controller
* W, A, S, D : manual commands
*/
/* TODO:
* -Define state and reward functions (StateAndReward.java) suitable for your problem --> done.
* -Define actions --> done.
* -Implement missing parts of Q-learning --> done.
* -Tune state and reward function, and parameters below if the result is not satisfactory */
public class QLearningController extends Controller {
// Change this value for part 3 (State & reward hover)
boolean HOVER_MODE = true;
/* These are the agents senses (inputs) */
DoubleFeature x; /* Positions */
DoubleFeature y;
DoubleFeature vx; /* Velocities */
DoubleFeature vy;
DoubleFeature angle; /* Angle */
/* These are the agents actuators (outputs)*/
RocketEngine leftEngine;
RocketEngine middleEngine;
RocketEngine rightEngine;
final static int NUM_ACTIONS = 7; /* The takeAction function must be changed if this is modified */
/* Keep track of the previous state and action */
String previous_state = null;
double previous_vx = 0;
double previous_vy = 0;
double previous_angle = 0;
int previous_action = 0;
/* The tables used by Q-learning */
Hashtable<String, Double> Qtable = new Hashtable<String, Double>(); /* Contains the Q-values - the state-action utilities */
Hashtable<String, Integer> Ntable = new Hashtable<String, Integer>(); /* Keeps track of how many times each state-action combination has been used */
/* PARAMETERS OF THE LEARNING ALGORITHM - THESE MAY BE TUNED BUT THE DEFAULT VALUES OFTEN WORK REASONABLY WELL */
static final double GAMMA_DISCOUNT_FACTOR = 0.95; /* Must be < 1, small values make it very greedy */
static final double LEARNING_RATE_CONSTANT = 10; /* See alpha(), lower values are good for quick results in large and deterministic state spaces */
double explore_chance = 0.5; /* The exploration chance during the exploration phase */
final static int REPEAT_ACTION_MAX = 30; /* Repeat selected action at most this many times trying reach a new state, without a max it could loop forever if the action cannot lead to a new state */
/* Some internal counters */
int iteration = 0; /* Keeps track of how many iterations the agent has run */
int action_counter = 0; /* Keeps track of how many times we have repeated the current action */
int print_counter = 0; /* Makes printouts less spammy */
/* These are just internal helper variables, you can ignore these */
boolean paused = false;
boolean explore = true; /* Will always do exploration by default */
DecimalFormat df = (DecimalFormat) NumberFormat.getNumberInstance(Locale.US);
public SpringObject object;
ComposedSpringObject cso;
long lastPressedExplore = 0;
public void init() {
cso = (ComposedSpringObject) object;
x = (DoubleFeature) cso.getObjectById("x");
y = (DoubleFeature) cso.getObjectById("y");
vx = (DoubleFeature) cso.getObjectById("vx");
vy = (DoubleFeature) cso.getObjectById("vy");
angle = (DoubleFeature) cso.getObjectById("angle");
previous_vy = vy.getValue();
previous_vx = vx.getValue();
previous_angle = angle.getValue();
leftEngine = (RocketEngine) cso.getObjectById("rocket_engine_left");
rightEngine = (RocketEngine) cso.getObjectById("rocket_engine_right");
middleEngine = (RocketEngine) cso.getObjectById("rocket_engine_middle");
}
/* Turn off all rockets */
void resetRockets() {
leftEngine.setBursting(false);
rightEngine.setBursting(false);
middleEngine.setBursting(false);
}
/* Performs the chosen action */
void performAction(int action) {
/* Fire zeh rockets! */
resetRockets();
switch (action) {
// Do nothing
case 0: break;
case 1: leftEngine.setBursting(true);
break;
case 2: rightEngine.setBursting(true);
break;
case 3: middleEngine.setBursting(true);
break;
case 4: leftEngine.setBursting(true);
middleEngine.setBursting(true);
break;
case 5: rightEngine.setBursting(true);
middleEngine.setBursting(true);
break;
case 6: middleEngine.setBursting(true);
leftEngine.setBursting(true);
rightEngine.setBursting(true);
break;
case 7: rightEngine.setBursting(true);
leftEngine.setBursting(true);
break;
}
}
/* Main decision loop. Called every iteration by the simulator */
public void tick(int currentTime) {
iteration++;
if (!paused) {
String new_state;
double previous_reward;
// You can choose the value of HOVER_MODE line 19 (for part 3)
if (!HOVER_MODE) {
new_state = StateAndReward.getStateAngle(angle.getValue(), vx.getValue(), vy.getValue());
previous_reward = StateAndReward.getRewardAngle(previous_angle, previous_vx, previous_vy);
}
else {
new_state = StateAndReward.getStateHover(angle.getValue(), vx.getValue(), vy.getValue());
previous_reward = StateAndReward.getRewardHover(previous_angle, previous_vx, previous_vy);
}
/* Repeat the chosen action for a while, hoping to reach a new state. This is a trick to speed up learning on this problem. */
action_counter++;
if (new_state.equals(previous_state) && action_counter < REPEAT_ACTION_MAX) {
return;
}
action_counter = 0;
/* The agent is in a new state, do learning and action selection */
if (previous_state != null) {
/* Create state-action key */
String prev_stateaction = previous_state + previous_action;
/* Increment state-action counter */
if (Ntable.get(prev_stateaction) == null) {
Ntable.put(prev_stateaction, 0);
}
Ntable.put(prev_stateaction, Ntable.get(prev_stateaction) + 1);
/* Update Q value */
if (Qtable.get(prev_stateaction) == null) {
Qtable.put(prev_stateaction, 0.0);
} else {
// Here, we use temporal-difference Q-learning equation, as define in
// AI: A Modern Approach, 4th ed. (Russell, Norvig) p. 802 (22.7):
// Q(s,a) <-- Q(s,a) + alpha*[R(s,a,s') + gamma*max(a')(Q(s',a')) - Q(s,a)]
// where: alpha --> learning rate
// gamma --> discount factor
double gamma = GAMMA_DISCOUNT_FACTOR;
double alpha = alpha(Ntable.get(prev_stateaction));
double Q = Qtable.get(prev_stateaction)
+ alpha*(previous_reward + gamma*getMaxActionQValue(new_state) - Qtable.get(prev_stateaction));
Qtable.put(prev_stateaction, Q);
// done.
}
int action = selectAction(new_state); /* Make sure you understand how it selects an action */
performAction(action);
/* Only print every 10th line to reduce spam */
print_counter++;
if (print_counter % 1000 == 0) {
System.out.println("ITERATION: " + iteration + " SENSORS: a=" + df.format(angle.getValue()) + " vx=" + df.format(vx.getValue()) +
" vy=" + df.format(vy.getValue()) + " P_STATE: " + previous_state + " P_ACTION: " + previous_action +
" P_REWARD: " + df.format(previous_reward) + " P_QVAL: " + df.format(Qtable.get(prev_stateaction)) + " Tested: "
+ Ntable.get(prev_stateaction) + " times.");
}
previous_vy = vy.getValue();
previous_vx = vx.getValue();
previous_angle = angle.getValue();
previous_action = action;
}
previous_state = new_state;
}
}
/* Computes the learning rate parameter alpha based on the number of times the state-action combination has been tested */
public double alpha(int num_tested) {
/* Lower learning rate constants means that alpha will become small faster and therefore make the agent behavior converge to
* to a solution faster, but if the state space is not properly explored at that point the resulting behavior may be poor.
* If your state-space is really huge you may need to increase it. */
double alpha = (LEARNING_RATE_CONSTANT/(LEARNING_RATE_CONSTANT + num_tested));
return alpha;
}
/* Finds the highest Qvalue of any action in the given state */
public double getMaxActionQValue(String state) {
double maxQval = Double.NEGATIVE_INFINITY;
for (int action = 0; action < NUM_ACTIONS; action++) {
Double Qval = Qtable.get(state+action);
if (Qval != null && Qval > maxQval) {
maxQval = Qval;
}
}
if (maxQval == Double.NEGATIVE_INFINITY) {
/* Assign 0 as that corresponds to initializing the Qtable to 0. */
maxQval = 0;
}
return maxQval;
}
/* Selects an action in a state based on the registered Q-values and the exploration chance */
public int selectAction(String state) {
Random rand = new Random();
int action = 0;
/* May do exploratory move if in exploration mode */
if (explore && Math.abs(rand.nextDouble()) < explore_chance) {
/* Taking random exploration action! */
action = Math.abs(rand. nextInt()) % NUM_ACTIONS;
return action;
}
/* Find action with highest Q-val (utility) in given state */
double maxQval = Double.NEGATIVE_INFINITY;
for (int i = 0; i < NUM_ACTIONS; i++) {
String test_pair = state + i; /* Generate a state-action pair for all actions */
double Qval = 0;
if (Qtable.get(test_pair) != null) {
Qval = Qtable.get(test_pair);
}
if (Qval > maxQval) {
maxQval = Qval;
action = i;
}
}
return action;
}
/* The 'E' key will toggle the agents exploration mode. Turn this off to test its behavior */
public void toggleExplore() {
/* Make sure we don't toggle it multiple times */
if (System.currentTimeMillis() - lastPressedExplore < 1000) {
return;
}
if (explore) {
System.out.println("Turning OFF exploration!");
explore = false;
} else {
System.out.println("Turning ON exploration!");
explore = true;
}
lastPressedExplore = System.currentTimeMillis();
}
/* Keys 1 and 2 can be customized for whatever purpose if you want to */
public void toggleCustom1() {
System.out.println("Custom key 1 pressed!");
}
/* Keys 1 and 2 can be customized for whatever purpose if you want to */
public void toggleCustom2() {
System.out.println("Custom key 2 pressed!");
}
public void pause() {
paused = true;
resetRockets();
}
public void run() {
paused = false;
}
}

87
lab5/StateAndReward.java Normal file
View file

@ -0,0 +1,87 @@
public class StateAndReward {
/* State discretization function for the angle controller */
public static String getStateAngle(double angle, double vx, double vy) {
return " " + discretize2(angle, 20, 2*-Math.PI/3, 2*Math.PI/3) + " ";
}
/* Reward function for the angle controller */
public static double getRewardAngle(double angle, double vx, double vy) {
return Math.PI - Math.abs(angle);
}
/* State discretization function for the full hover controller */
public static String getStateHover(double angle, double vx, double vy) {
return discretize2(angle, 10, 2*-Math.PI/3, 2*Math.PI/3)
+ " / " + discretize(vx, 3, -1, 1)
+ " / " + discretize(vy, 11, -1, 1);
}
/* Reward function for the full hover controller */
public static double getRewardHover(double angle, double vx, double vy) {
return (Math.PI - Math.abs(angle))/2 + (10 - Math.abs(Math.max(Math.abs(vx), Math.abs(vy)))) / 5;
}
// ///////////////////////////////////////////////////////////
// discretize() performs a uniform discretization of the
// value parameter.
// It returns an integer between 0 and nrValues-1.
// The min and max parameters are used to specify the interval
// for the discretization.
// If the value is lower than min, 0 is returned
// If the value is higher than min, nrValues-1 is returned
// otherwise a value between 1 and nrValues-2 is returned.
//
// Use discretize2() if you want a discretization method that does
// not handle values lower than min and higher than max.
// ///////////////////////////////////////////////////////////
public static int discretize(double value, int nrValues, double min,
double max) {
if (nrValues < 2) {
return 0;
}
double diff = max - min;
if (value < min) {
return 0;
}
if (value > max) {
return nrValues - 1;
}
double tempValue = value - min;
double ratio = tempValue / diff;
return (int) (ratio * (nrValues - 2)) + 1;
}
// ///////////////////////////////////////////////////////////
// discretize2() performs a uniform discretization of the
// value parameter.
// It returns an integer between 0 and nrValues-1.
// The min and max parameters are used to specify the interval
// for the discretization.
// If the value is lower than min, 0 is returned
// If the value is higher than min, nrValues-1 is returned
// otherwise a value between 0 and nrValues-1 is returned.
// ///////////////////////////////////////////////////////////
public static int discretize2(double value, int nrValues, double min,
double max) {
double diff = max - min;
if (value < min) {
return 0;
}
if (value > max) {
return nrValues - 1;
}
double tempValue = value - min;
double ratio = tempValue / diff;
return (int) (ratio * nrValues);
}
}

View file

@ -0,0 +1,80 @@
// INFO: See below.
public class TutorialController extends Controller {
public SpringObject object;
ComposedSpringObject cso;
/* These are the agents senses (inputs) */
DoubleFeature x; /* Positions */
DoubleFeature y;
DoubleFeature vx; /* Velocities */
DoubleFeature vy;
DoubleFeature angle; /* Angle */
/* Example:
* x.getValue() returns the vertical position of the rocket
*/
/* These are the agents actuators (outputs)*/
RocketEngine leftRocket;
RocketEngine middleRocket;
RocketEngine rightRocket;
/* Example:
* leftRocket.setBursting(true) turns on the left rocket
*/
public void init() {
cso = (ComposedSpringObject) object;
x = (DoubleFeature) cso.getObjectById("x");
y = (DoubleFeature) cso.getObjectById("y");
vx = (DoubleFeature) cso.getObjectById("vx");
vy = (DoubleFeature) cso.getObjectById("vy");
angle = (DoubleFeature) cso.getObjectById("angle");
leftRocket = (RocketEngine) cso.getObjectById("rocket_engine_left");
rightRocket = (RocketEngine) cso.getObjectById("rocket_engine_right");
middleRocket = (RocketEngine) cso.getObjectById("rocket_engine_middle");
}
public void tick(int currentTime) {
// TDDC17
// Part1: Print useful informations and use
// threshold to guide the vessel
System.out.println("Tick: " + currentTime + ". Angle: " + angle.getValue() + ", vx: " + vx.getValue() + ", vy: " + vy.getValue());
System.out.print("Vessel state: ");
if (angle.getValue() > 0.01) {
rightRocket.setBursting(true);
System.out.print("ENG_RGT ON; ");
}
else {
rightRocket.setBursting(false);
System.out.print("ENG_RGT OFF; ");
}
if (angle.getValue() < -0.01) {
leftRocket.setBursting(true);
System.out.print("ENG_LFT ON; ");
}
else {
leftRocket.setBursting(false);
System.out.print("ENG_LFT OFF; ");
}
if (vy.getValue() > 0.05) {
middleRocket.setBursting(true);
System.out.print("ENG_MDL ON; ");
}
else {
middleRocket.setBursting(false);
System.out.print("ENG_MDL OFF; ");
}
System.out.println("");
}
}