Compare commits
51 Commits
stable
...
dev/archéo
Author | SHA1 | Date |
---|---|---|
Jean Sirmai | 52a1315eb2 | |
Jean Sirmai | be2fe2e451 | |
Jean Sirmai | 317487bf15 | |
Jean Sirmai | 2df3d7a4e4 | |
Jean Sirmai | be49924523 | |
Jean Sirmai | 124b314271 | |
Jean Sirmai | fbb0dfcfb6 | |
Jean Sirmai | cf5ff788fa | |
Jean Sirmai | 648072f59d | |
Jean Sirmai | ae6981a624 | |
Jean Sirmai | 75c63e8e24 | |
Jean Sirmai | 5751a6cd72 | |
Jean Sirmai | 29c8d0c127 | |
Jean Sirmai | a78e3f7bb6 | |
Jean Sirmai | fe668f3720 | |
Jean Sirmai | 93f4a5e2e2 | |
Jean Sirmai | e364b97cbf | |
Jean Sirmai | 46db1e5ad6 | |
Jean Sirmai | 4cec4b1855 | |
Jean Sirmai | 9e327a2643 | |
Jean Sirmai | 5f70690871 | |
Jean Sirmai | ef03bd717b | |
Jean Sirmai | 0e226e5cc8 | |
Jean Sirmai | 8a7f97f53a | |
Jean Sirmai | 5a52450ae1 | |
Jean Sirmai | f230ad3a73 | |
Jean Sirmai | 768e3ca8a3 | |
Jean Sirmai | 5277401f81 | |
Jean Sirmai | 3cb73c7abb | |
Jean Sirmai | c796b06451 | |
Jean Sirmai | ea93bd0aad | |
Jean Sirmai | f445d4d534 | |
Jean Sirmai | 5b1e27d670 | |
Jean Sirmai | d430332c3f | |
Jean Sirmai | a009d0e402 | |
Jean Sirmai | 7e6f5023a1 | |
Jean Sirmai | 3517e73de4 | |
Jean Sirmai | 9261bc03cf | |
Jean Sirmai | 71ddf7dd3d | |
Jean Sirmai | 0fd3966433 | |
Jean Sirmai | f068ca6731 | |
Jean Sirmai | 393303dbc5 | |
Jean Sirmai | c684bab6e3 | |
Jean Sirmai | 0f436bd8d6 | |
Adrien Bourmault | de7f61e156 | |
Adrien Bourmault | 5b9a7dbdfe | |
Adrien Bourmault | 929fc53e2c | |
Adrien Bourmault | 0b140a54c6 | |
Adrien Bourmault | fd24472805 | |
Adrien Bourmault | e0bb902ab8 | |
Adrien Bourmault | 221d95f4dc |
|
@ -0,0 +1,11 @@
|
||||||
|
before_script:
|
||||||
|
- python --version
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- Static Analysis
|
||||||
|
|
||||||
|
flake8:
|
||||||
|
stage: Static Analysis
|
||||||
|
script:
|
||||||
|
- flake8 --max-line-length=120 --ignore=E402,E266,W503 src/*.py
|
|
@ -0,0 +1,661 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 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 Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are 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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
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 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 work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero 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 Affero 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 Affero 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 Affero 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) 2021 Adrien Bourmault
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero 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 your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
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 AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
|
@ -0,0 +1,194 @@
|
||||||
|
# Gem-graph Client
|
||||||
|
|
||||||
|
## Procédure de développement (Bonnes pratiques)
|
||||||
|
|
||||||
|
### Une seule branche par fonctionnalité : dev/<fonctionnalité>
|
||||||
|
|
||||||
|
git fetch origin // récupère les branches sur le remote (git.a-lec.org)
|
||||||
|
git switch devel // car on part toujours de la branche devel
|
||||||
|
git branch dev/<fonctionnalité>
|
||||||
|
git switch dev/<fonctionnalité>
|
||||||
|
git push --set-upstream origin dev/<fonctionnalité> // dit au serveur que la branche existe
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
Une fois fonctionnalité terminée et push accompli, ouvrir une merge request à
|
||||||
|
l'aide du lien fourni par git push
|
||||||
|
|
||||||
|
|
||||||
|
### Lors du travail sur une branche (les [...] du premier point)
|
||||||
|
|
||||||
|
Pour chaque session de travail :
|
||||||
|
|
||||||
|
git pull
|
||||||
|
[...]
|
||||||
|
git commit -am "WIP: <message>"
|
||||||
|
git push
|
||||||
|
|
||||||
|
Une fois terminée la fonctionnalité et s'il y a un objectif de version :
|
||||||
|
|
||||||
|
git tag -a vM.m.p -m "Fonctionnalité terminée"
|
||||||
|
git commit -am "Fonctionnalité terminée"
|
||||||
|
git push
|
||||||
|
|
||||||
|
## Objectifs de développement
|
||||||
|
|
||||||
|
A gem-graph client can be used to:
|
||||||
|
|
||||||
|
- create or edit a gem-graph model
|
||||||
|
- control a run of a gem-graph model by a gem-graph server
|
||||||
|
- get and study the results of such a run
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
In order to execute these functions, it must be able to manage:
|
||||||
|
|
||||||
|
inputs / outputs
|
||||||
|
|
||||||
|
- load and save models
|
||||||
|
- use xml schemas to check the validity of models
|
||||||
|
- connect to an instance of gem-graph server
|
||||||
|
- dialog with this instance
|
||||||
|
|
||||||
|
a GUI able to:
|
||||||
|
|
||||||
|
- render and edit the model
|
||||||
|
- states
|
||||||
|
- objects types
|
||||||
|
- tags and references
|
||||||
|
- transitions (edition 'de novo' or starting from a state copy)
|
||||||
|
- transitions trees
|
||||||
|
- users trees
|
||||||
|
|
||||||
|
- control a run using commands:
|
||||||
|
- run / stop
|
||||||
|
- speed up / slow down
|
||||||
|
- do / undo / redo
|
||||||
|
- predefine run duration, sampling frequency and nature
|
||||||
|
- predefine interruption parameters
|
||||||
|
(according to server performances and/or model results)
|
||||||
|
- preselect the search algorithm in the conditions tree
|
||||||
|
|
||||||
|
- monitor performances of the server
|
||||||
|
|
||||||
|
- view and analyse the results of a run
|
||||||
|
- history
|
||||||
|
- phase diagrams (structures / fluxes)
|
||||||
|
- statistics
|
||||||
|
- errors
|
||||||
|
|
||||||
|
- facilitate usage of the software
|
||||||
|
- preferences
|
||||||
|
- context info
|
||||||
|
- help
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Definitions (see also: gem graph README and gem graph server README)
|
||||||
|
|
||||||
|
1) XML Schema
|
||||||
|
|
||||||
|
- According to the model xml schema,
|
||||||
|
a gem-graph model must include at least the following data groups:
|
||||||
|
|
||||||
|
+ identity (name, owner, creation date, version, references,...)
|
||||||
|
+ parameters (about simulation and space: dimension, size x y z,...)
|
||||||
|
+ objects: each object is a connex graph drawn as a set of arrows
|
||||||
|
+ savestates: each state (objects, situations, tags) is drawn as a set of arrows
|
||||||
|
+ transitions: each transition is defined as two sets of arrows
|
||||||
|
+ conditions: that are specified as nodes in a tree (see below)
|
||||||
|
|
||||||
|
|
||||||
|
2) Automaton rewriting a geometric graph
|
||||||
|
|
||||||
|
- A gem-graph is a geometric graph = a graph whose nodes have coordinates in a space.
|
||||||
|
- A gem-graph model describes an automaton that can rewrite a gem-graph.
|
||||||
|
- An automaton that can rewrite a gem-graph has to define states and transitions.
|
||||||
|
|
||||||
|
- States belong to a unique global space in which all the transitions occur.
|
||||||
|
- Each transition rewrites a part of the global space. This part is called the local space.
|
||||||
|
|
||||||
|
- States are drawn in spaces (global or local) using arrows.
|
||||||
|
- States can be combinations of objects, situations and/or tags.
|
||||||
|
- Objects and tags are connex graphs (i.e. graphs whose nodes are all connected).
|
||||||
|
- A situation describes the relative positions of several objects in the global space.
|
||||||
|
- A tag is a part of an object or situation which encodes a human readable text (annotation, ref, value,...).
|
||||||
|
|
||||||
|
- Several connex graphs can be used to describe the same object.
|
||||||
|
- An instance of the class object groups all these graphs plus some comments or values.
|
||||||
|
|
||||||
|
- Transitions are defined by an initial and a final local states.
|
||||||
|
- The initial state of a transition can be evaluated by a set of conditions.
|
||||||
|
- Each condition is defined as the association of:
|
||||||
|
|
||||||
|
+ a location (space unit (x, y, z) and site number)
|
||||||
|
+ an arrow number (or weight) as several arrows can be stacked at the same location
|
||||||
|
|
||||||
|
|
||||||
|
- All the conditions can be ordered in a single tree: the 'tree of conditions' (see below).
|
||||||
|
- In the XML model file, in order to write and read this tree,
|
||||||
|
each condition has a node identifier (node_id) and a parent.
|
||||||
|
|
||||||
|
|
||||||
|
3) Data structures
|
||||||
|
|
||||||
|
- Arrows are represented (encoded) by numbers in sites.
|
||||||
|
- In each space units is a finite number of sites.
|
||||||
|
- The site 0 always points towards its own space unit.
|
||||||
|
- Each other site points towards a neighbouring (not necessarily adjacent) state unit.
|
||||||
|
- Each site of each space unit can 'contain' 0 or n arrows.
|
||||||
|
- The set of states of all the sites of all the space units defines a space state.
|
||||||
|
|
||||||
|
- A condition is satisfied if both following quantities are equal:
|
||||||
|
+ the number of arrows (or weights) specified by the condition
|
||||||
|
+ the number of arrows present in the space at the same location specified by the condition.
|
||||||
|
|
||||||
|
|
||||||
|
- When conditions are evaluated by the automaton, these two values are compared.
|
||||||
|
- These evaluations are done by threads (workers) managed by the scheduler of the server.
|
||||||
|
|
||||||
|
- A transition rule associates several conditions to several assignments.
|
||||||
|
- An assignment instruction assigns a number (n) of arrows to a site of a space unit of the global space.
|
||||||
|
|
||||||
|
- The conditions of a transition rule must all be satisfied for this rule to be applied.
|
||||||
|
|
||||||
|
- Several transition rules can have conditions that read the same site.
|
||||||
|
- As all the transition rules share at least one common conditions on the local space origin,
|
||||||
|
all the conditions of all the transition rules can be ordered as a single conditions tree.
|
||||||
|
- In this conditions tree, each condition is a node and each set of assignments is a leave.
|
||||||
|
- The root of this tree is the condition on the local space origin.
|
||||||
|
- The other conditions are met by following a predefined path through all the locations of the local space.
|
||||||
|
- This path is determined by the user according to the design and performances of the model.
|
||||||
|
- In the XML model file, in order to write and read the conditions tree, each condition has a node identifier and a parent.
|
||||||
|
|
||||||
|
|
||||||
|
4) Algorithms
|
||||||
|
|
||||||
|
- The search of a transition rule in the conditions tree is done by the threads of the scheduler (see gem-graph-server README)
|
||||||
|
- The result of these searches can be:
|
||||||
|
+ success (the founded rule is applied)
|
||||||
|
+ failure (there is no rule for this situation; the local situation is returned to the client)
|
||||||
|
+ error
|
||||||
|
|
||||||
|
- The rules and the conditions tree are designed by the client and executed by the server scheduler threads.
|
||||||
|
It is the responsability of the user to manage:
|
||||||
|
+ conditions deficit, conflicts and redundancy
|
||||||
|
+ rules deficit, conflicts and redundancy
|
||||||
|
+ optimisation of the conditions tree by design of an adequate path through all the locations of the local space
|
||||||
|
+ approximations of objects, situations and phenomena
|
||||||
|
|
||||||
|
|
||||||
|
5) Meta-edition (future)
|
||||||
|
|
||||||
|
- As mentionned above, several connex graphs can be used to describe the same object.
|
||||||
|
- An instance of the class object, called a meta-object, then groups all these graphs plus some comments or values.
|
||||||
|
|
||||||
|
- In future versions, the client should provide tools in order to help model designers to edit
|
||||||
|
+ objects from meta-objects. (vectorisation)
|
||||||
|
+ transitions from meta-transitions. (AI ?)
|
||||||
|
|
||||||
|
|
||||||
|
NB Adequate data structures should describe these meta-transitions and meta-objets.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
|
@ -0,0 +1,121 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gem-graph-model version="0.2.1">
|
||||||
|
|
||||||
|
<identity>
|
||||||
|
<name>Chrysalide</name>
|
||||||
|
|
||||||
|
<owner>Léontine qui patine</owner>
|
||||||
|
|
||||||
|
<owner_id>2</owner_id>
|
||||||
|
|
||||||
|
<date>1630000000</date>
|
||||||
|
|
||||||
|
<version>1.0</version>
|
||||||
|
|
||||||
|
<g_ref id="diff" date="1630000000" author="Léontine" lang="en">Qui ça ?'</g_ref>
|
||||||
|
</identity>
|
||||||
|
|
||||||
|
<parameters id="texte" date="0" author="Léontine qui trottine.">
|
||||||
|
<simulation>
|
||||||
|
<max_thread>0</max_thread>
|
||||||
|
<max_cycles>9</max_cycles>
|
||||||
|
|
||||||
|
</simulation>
|
||||||
|
|
||||||
|
<space-param>
|
||||||
|
<!-- loop_on_zero="true" anything moved before zero reenters at the end of space-->
|
||||||
|
<!-- loop_on_zero="false" anything moved before zero is lost-->
|
||||||
|
<!-- loop_on_max="true" anything moved beyond max reenters at the zero of space-->
|
||||||
|
<!-- loop_on_max="false" anything moved beyond max is lost-->
|
||||||
|
|
||||||
|
<dimension x="20"/>
|
||||||
|
|
||||||
|
<!-- Site_multiplicity = number of sites in a space unit. -->
|
||||||
|
<!-- Each site points towards a neighbouring space unit. -->
|
||||||
|
<!-- Several arrows can be stacked in the same site. -->
|
||||||
|
|
||||||
|
<site_multiplicity>3</site_multiplicity>
|
||||||
|
|
||||||
|
</space-param>
|
||||||
|
|
||||||
|
</parameters>
|
||||||
|
|
||||||
|
<!-- Model objects definition -->
|
||||||
|
|
||||||
|
<objects id="only dimers in this model" date="1630000000" author="inanimés,... âme ?">
|
||||||
|
<object id="a dimer" date="1630000000" author="Alphonse">
|
||||||
|
<arrow site="1" weight="1" x="0"/>
|
||||||
|
<arrow site="2" weight="1" x="1"/>
|
||||||
|
</object>
|
||||||
|
|
||||||
|
</objects>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Saved space description (initial space is sequence 0) -->
|
||||||
|
|
||||||
|
<states id="texte" date="1630000000" author="Here, states are spaces.">
|
||||||
|
<space id="initial" date="1630000000" author="Une souris verte,">
|
||||||
|
<arrow site="0" weight="6" x="0"/>
|
||||||
|
<arrow site="1" weight="1" x="0"/>
|
||||||
|
<arrow site="2" weight="7" x="1"/>
|
||||||
|
<arrow site="1" weight="3" x="6"/>
|
||||||
|
<arrow site="2" weight="1" x="7"/>
|
||||||
|
<arrow site="1" weight="4" x="14"/>
|
||||||
|
<arrow site="0" weight="8" x="14"/>
|
||||||
|
<arrow site="2" weight="5" x="15"/>
|
||||||
|
<arrow site="1" weight="2" x="17"/>
|
||||||
|
<arrow site="2" weight="7" x="18"/>
|
||||||
|
<arrow site="2" weight="9" x="20"/>
|
||||||
|
<arrow site="0" weight="4" x="20"/>
|
||||||
|
|
||||||
|
</space>
|
||||||
|
|
||||||
|
</states>
|
||||||
|
|
||||||
|
<!-- Model transitions definition (rules) -->
|
||||||
|
<!-- In this version : <xs:sequence minOccurs="0" maxOccurs="unbounded">-->
|
||||||
|
<!-- Transitions should be edited by hand and written in a 'human-readable' format -->
|
||||||
|
|
||||||
|
<conditions id="random walk of dimers" date="1630000000" author="Zazard le lézard !">
|
||||||
|
|
||||||
|
<condition site="1" weight="1" node_id="1" parent="0" x="0"/>
|
||||||
|
<condition site="2" weight="1" node_id="2" parent="1" x="1"/>
|
||||||
|
<!-- if conditions 1 and 2 are satisfied, a dimer is identified at loc (0,1). -->
|
||||||
|
|
||||||
|
<condition site="1" weight="0" node_id="3" parent="2" x="2"/>
|
||||||
|
<!-- if condition 3 is satisfied,
|
||||||
|
the neighbouring space unhit to East of the dimer is empty
|
||||||
|
and the dimer identified by conditions (1,2) can be moved to East. -->
|
||||||
|
|
||||||
|
<condition site="2" weight="0" node_id="4" parent="2" x="-1"/>
|
||||||
|
<!-- if condition 4 is satisfied,
|
||||||
|
the neighbouring space unit to West of the dimer is empty
|
||||||
|
and the dimer identified by conditions (1,2) can be moved to West. -->
|
||||||
|
|
||||||
|
</conditions>
|
||||||
|
|
||||||
|
<transitions>
|
||||||
|
|
||||||
|
<transition id="move_a_dimer_to_east" date="1630000000" author="Pas moi..."
|
||||||
|
parent="3" probability="1">
|
||||||
|
|
||||||
|
<arrow site="1" weight="0" x="0"/>
|
||||||
|
<arrow site="2" weight="0" x="1"/>
|
||||||
|
<arrow site="1" weight="1" x="1"/>
|
||||||
|
<arrow site="2" weight="1" x="2"/>
|
||||||
|
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<transition id="move_a_dimer_to_west" date="1630000000" author="Ni moi !"
|
||||||
|
parent="4" probability="1">
|
||||||
|
|
||||||
|
<arrow site="1" weight="0" x="0"/>
|
||||||
|
<arrow site="2" weight="0" x="1"/>
|
||||||
|
<arrow site="2" weight="1" x="0"/>
|
||||||
|
<arrow site="1" weight="1" x="1"/>
|
||||||
|
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
</transitions>
|
||||||
|
|
||||||
|
</gem-graph-model>
|
|
@ -0,0 +1 @@
|
||||||
|
('(b,(c,(d,(e,(f,g))h)i)a)')[0]
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
|
||||||
|
|
||||||
|
<xs:attribute name="id" type="xs:string"/>
|
||||||
|
<xs:attribute name="pp" type="xs:string"/>
|
||||||
|
<xs:attribute name="rank" type="xs:string"/>
|
||||||
|
|
||||||
|
<!--<proposition id="00" parent="None">a text</proposition>-->
|
||||||
|
|
||||||
|
<xs:element name="p">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute ref="id" use="required"/>
|
||||||
|
<xs:attribute ref="pp" use="required"/>
|
||||||
|
<xs:attribute ref="rank" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="root">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="p"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="version" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
|
|
|
@ -0,0 +1,194 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
|
||||||
|
<xs:attribute name="id" type="xs:string"/>
|
||||||
|
<xs:attribute name="node_id" type="xs:integer"/>
|
||||||
|
<xs:attribute name="parent" type="xs:integer"/>
|
||||||
|
<xs:attribute name="date" type="xs:integer"/>
|
||||||
|
<xs:attribute name="name" type="xs:string"/>
|
||||||
|
<xs:attribute name="lang" type="xs:string"/>
|
||||||
|
<xs:attribute name="owner" type="xs:string"/>
|
||||||
|
<xs:attribute name="owner_id" type="xs:integer"/>
|
||||||
|
<xs:attribute name="author" type="xs:string"/>
|
||||||
|
<xs:attribute name="version" type="xs:string"/>
|
||||||
|
<xs:attribute name="probability" type="xs:integer"/>
|
||||||
|
<xs:attribute name="site" type="xs:integer" default="0"/>
|
||||||
|
<xs:attribute name="weight" type="xs:integer" default="0"/>
|
||||||
|
|
||||||
|
<!-- As it may be understand as 'time',
|
||||||
|
name "t" should not be used as an axis name :
|
||||||
|
in space phases models, time cannot be an axis -->
|
||||||
|
|
||||||
|
<xs:attribute name="u" type="xs:integer"/>
|
||||||
|
<xs:attribute name="v" type="xs:integer"/>
|
||||||
|
<xs:attribute name="w" type="xs:integer"/>
|
||||||
|
<xs:attribute name="x" type="xs:integer"/>
|
||||||
|
<xs:attribute name="y" type="xs:integer"/>
|
||||||
|
<xs:attribute name="z" type="xs:integer"/>
|
||||||
|
|
||||||
|
<xs:attributeGroup name="id_date_author">
|
||||||
|
<xs:attribute ref="id"/>
|
||||||
|
<xs:attribute ref="date"/>
|
||||||
|
<xs:attribute ref="author"/>
|
||||||
|
</xs:attributeGroup>
|
||||||
|
|
||||||
|
<xs:element name="g_ref">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
<xs:attribute ref="lang" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="quote" substitutionGroup="g_ref"/>
|
||||||
|
|
||||||
|
<xs:element name="dimension">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="arrow">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="site" use="required"/>
|
||||||
|
<xs:attribute ref="weight" use="required"/>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="condition">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="site" use="required"/>
|
||||||
|
<xs:attribute ref="weight" use="required"/>
|
||||||
|
<xs:attribute ref="node_id" use="required"/>
|
||||||
|
<xs:attribute ref="parent" use="required"/>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="space">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="arrow"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="object" substitutionGroup="space"/>
|
||||||
|
|
||||||
|
<xs:element name="transition">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element minOccurs="0" ref="quote"/>
|
||||||
|
<xs:element ref="arrow"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
<xs:attribute ref="parent" use="required"/>
|
||||||
|
<xs:attribute ref="probability" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="gem-graph-model">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="identity">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="name" type="xs:string"/>
|
||||||
|
<xs:element name="owner" type="xs:string"/>
|
||||||
|
<xs:element name="owner_id" type="xs:integer"/>
|
||||||
|
<xs:element name="date" type="xs:integer"/>
|
||||||
|
<xs:element name="version" type="xs:float"/>
|
||||||
|
<xs:element ref="g_ref" minOccurs="1" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="parameters">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
|
||||||
|
<xs:element name="simulation">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="max_thread" type="xs:integer"/>
|
||||||
|
<xs:element name="max_cycles" type="xs:integer"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="space-param">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element ref="dimension"/>
|
||||||
|
<xs:element name="site_multiplicity" type="xs:integer"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="objects">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="object"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="states">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="space"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="conditions">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element minOccurs="0" ref="quote"/>
|
||||||
|
<xs:element ref="condition"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="transitions">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="transition"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute ref="version" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
|
|
|
@ -0,0 +1,194 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
|
||||||
|
<xs:attribute name="id" type="xs:string"/>
|
||||||
|
<xs:attribute name="node_id" type="xs:integer"/>
|
||||||
|
<xs:attribute name="parent" type="xs:integer"/>
|
||||||
|
<xs:attribute name="date" type="xs:integer"/>
|
||||||
|
<xs:attribute name="name" type="xs:string"/>
|
||||||
|
<xs:attribute name="lang" type="xs:string"/>
|
||||||
|
<xs:attribute name="owner" type="xs:string"/>
|
||||||
|
<xs:attribute name="owner_id" type="xs:integer"/>
|
||||||
|
<xs:attribute name="author" type="xs:string"/>
|
||||||
|
<xs:attribute name="version" type="xs:string"/>
|
||||||
|
<xs:attribute name="probability" type="xs:integer"/>
|
||||||
|
<xs:attribute name="site" type="xs:integer" default="0"/>
|
||||||
|
<xs:attribute name="weight" type="xs:integer" default="0"/>
|
||||||
|
|
||||||
|
<!-- As it may be understand as 'time',
|
||||||
|
name "t" should not be used as an axis name :
|
||||||
|
in space phases models, time cannot be an axis -->
|
||||||
|
|
||||||
|
<xs:attribute name="u" type="xs:integer"/>
|
||||||
|
<xs:attribute name="v" type="xs:integer"/>
|
||||||
|
<xs:attribute name="w" type="xs:integer"/>
|
||||||
|
<xs:attribute name="x" type="xs:integer"/>
|
||||||
|
<xs:attribute name="y" type="xs:integer"/>
|
||||||
|
<xs:attribute name="z" type="xs:integer"/>
|
||||||
|
|
||||||
|
<xs:attributeGroup name="id_date_author">
|
||||||
|
<xs:attribute ref="id"/>
|
||||||
|
<xs:attribute ref="date"/>
|
||||||
|
<xs:attribute ref="author"/>
|
||||||
|
</xs:attributeGroup>
|
||||||
|
|
||||||
|
<xs:element name="g_ref">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
<xs:attribute ref="lang" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="quote" substitutionGroup="g_ref"/>
|
||||||
|
|
||||||
|
<xs:element name="dimension">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="arrow">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="site" use="required"/>
|
||||||
|
<xs:attribute ref="weight" use="required"/>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="condition">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:attribute ref="site" use="required"/>
|
||||||
|
<xs:attribute ref="weight" use="required"/>
|
||||||
|
<xs:attribute ref="node_id" use="required"/>
|
||||||
|
<xs:attribute ref="parent" use="required"/>
|
||||||
|
<xs:attribute ref="u" use="optional"/>
|
||||||
|
<xs:attribute ref="v" use="optional"/>
|
||||||
|
<xs:attribute ref="w" use="optional"/>
|
||||||
|
<xs:attribute ref="x" use="optional"/>
|
||||||
|
<xs:attribute ref="y" use="optional"/>
|
||||||
|
<xs:attribute ref="z" use="optional"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="space">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="arrow"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="object" substitutionGroup="space"/>
|
||||||
|
|
||||||
|
<xs:element name="transition">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element minOccurs="0" ref="quote"/>
|
||||||
|
<xs:element ref="arrow"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
<xs:attribute ref="parent" use="required"/>
|
||||||
|
<xs:attribute ref="probability" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="gem-graph-model">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="identity">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="name" type="xs:string"/>
|
||||||
|
<xs:element name="owner" type="xs:string"/>
|
||||||
|
<xs:element name="owner_id" type="xs:integer"/>
|
||||||
|
<xs:element name="date" type="xs:integer"/>
|
||||||
|
<xs:element name="version" type="xs:float"/>
|
||||||
|
<xs:element ref="g_ref" minOccurs="1" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="parameters">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
|
||||||
|
<xs:element name="simulation">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element name="max_thread" type="xs:integer"/>
|
||||||
|
<xs:element name="max_cycles" type="xs:integer"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="space-param">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||||
|
<xs:element ref="dimension"/>
|
||||||
|
<xs:element name="site_multiplicity" type="xs:integer"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="objects">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="object"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="states">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="space"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="conditions">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element minOccurs="0" ref="quote"/>
|
||||||
|
<xs:element ref="condition"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attributeGroup ref="id_date_author"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="transitions">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="transition"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute ref="version" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<!-- https://www.freeformatter.com/xml-validator-xsd.html -->
|
||||||
|
|
||||||
|
<xs:attribute name="id" type="xs:string"/>
|
||||||
|
<xs:attribute name="pp" type="xs:string"/>
|
||||||
|
<xs:attribute name="rank" type="xs:string"/>
|
||||||
|
|
||||||
|
<!--<proposition id="00" parent="None">a text</proposition>-->
|
||||||
|
|
||||||
|
<xs:element name="p">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="xs:string">
|
||||||
|
<xs:attribute ref="id" use="required"/>
|
||||||
|
<xs:attribute ref="pp" use="required"/>
|
||||||
|
<xs:attribute ref="rank" use="optional"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name="root">
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs="1" maxOccurs="unbounded">
|
||||||
|
<xs:element ref="p"/>
|
||||||
|
</xs:sequence>
|
||||||
|
<xs:attribute name="version" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,62 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import gi
|
||||||
|
import files_addr
|
||||||
|
import rules_tree
|
||||||
|
|
||||||
|
gi.require_version("Gtk", "3.0")
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from lxml import etree # r = Resolver()
|
||||||
|
from anytree import NodeMixin, RenderTree, Resolver, AsciiStyle, LevelOrderIter
|
||||||
|
|
||||||
|
class Window(Gtk.Window):
|
||||||
|
|
||||||
|
def create_editable_tree(self, store, tree):
|
||||||
|
Gtk_node = [None] * 10
|
||||||
|
sketch = ''
|
||||||
|
nb = 0
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
if node.is_root:
|
||||||
|
Gtk_node[nb] = store.append(parent=None, row=[0, 'root ' + str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre + '᠇', ' node ' + str(node.id) + ' (root)\n')
|
||||||
|
else:
|
||||||
|
nb += 1
|
||||||
|
if node.is_leaf:
|
||||||
|
Gtk_node[nb] = store.append(parent = Gtk_node[node.parent.id],
|
||||||
|
row = [nb, str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre, str(node.id) + '\n')
|
||||||
|
else:
|
||||||
|
Gtk_node[nb] = store.append(parent = Gtk_node[node.parent.id],
|
||||||
|
row = [nb, 'node ' + str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre + '᠇', ' node' + str(node.id) + '\n')
|
||||||
|
sketch += "\n"
|
||||||
|
print(sketch)
|
||||||
|
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__(title="Minimal Tree View")
|
||||||
|
tree = rules_tree.get_tree()
|
||||||
|
|
||||||
|
self.my_tree_store = Gtk.TreeStore(int, str)
|
||||||
|
self.create_editable_tree(self.my_tree_store, tree)
|
||||||
|
|
||||||
|
self.current_filter_button = None
|
||||||
|
self.language_filter = self.my_tree_store.filter_new()
|
||||||
|
|
||||||
|
self.treeview = Gtk.TreeView(model=self.language_filter)
|
||||||
|
for i, column_title in enumerate(["Row", "Path"]):
|
||||||
|
renderer = Gtk.CellRendererText()
|
||||||
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
|
self.treeview.append_column(column)
|
||||||
|
|
||||||
|
self.scrollable_treelist = Gtk.ScrolledWindow()
|
||||||
|
self.scrollable_treelist.add(self.treeview)
|
||||||
|
|
||||||
|
self.tree_viewport = Gtk.Viewport()
|
||||||
|
self.tree_viewport.add(self.scrollable_treelist)
|
||||||
|
self.tree_viewport.set_size_request(300, 200)
|
||||||
|
self.add(self.tree_viewport)
|
||||||
|
|
||||||
|
win = Window()
|
||||||
|
win.connect("destroy", Gtk.main_quit)
|
||||||
|
win.show_all()
|
||||||
|
#Gtk.main()
|
|
@ -0,0 +1,248 @@
|
||||||
|
# import measures.MeasuresManager
|
||||||
|
# import rule.FormulasManager
|
||||||
|
# import rule.FormulasManagerAccess
|
||||||
|
# import session.ViewControls
|
||||||
|
# import state.StateManager
|
||||||
|
# import state.StateManagerLocal
|
||||||
|
# import views.MODEL
|
||||||
|
# import views.ViewsManagerAccess
|
||||||
|
|
||||||
|
# @see MonoThread
|
||||||
|
class Formula():
|
||||||
|
def getFormula():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def doActions():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ViewControls():
|
||||||
|
|
||||||
|
def isDoSelected():
|
||||||
|
return True
|
||||||
|
|
||||||
|
def execDo():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ViewsManagerAccess():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class StateManagerLocal():
|
||||||
|
def getReferenceOrientation_1():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class FormulasManager():
|
||||||
|
def iterateToFindAFormula():
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def getFormula(formula_key):
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
class MeasuresManager():
|
||||||
|
def startMeasuringAFormulaEffect(formula_key):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def endMeasuringAFormulaEffect(formula_key):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class SingleTransition:
|
||||||
|
'''
|
||||||
|
SingleTransition is a loop with one interruption and two instructions:
|
||||||
|
if (session.MainView.isStartStopButtonSelected())
|
||||||
|
state.StateManagerLocal.chooseLocalOrigin(false)
|
||||||
|
new SingleTransition(true)
|
||||||
|
'''
|
||||||
|
|
||||||
|
is_done = False
|
||||||
|
elapsed = ''
|
||||||
|
present = 0
|
||||||
|
selected_formula = -1
|
||||||
|
undoStackSize = 100 # used by ViewControls (for image of the buffer state)
|
||||||
|
formula = [0, 1, 2]
|
||||||
|
x = []
|
||||||
|
y = []
|
||||||
|
z = []
|
||||||
|
o = [0, 1, 2]
|
||||||
|
DO_UNDO_REDO_comment = False
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.present = 0
|
||||||
|
# if (step_by_step) StateManagerLocal.circlePresentState()
|
||||||
|
if ViewControls.isDoSelected():
|
||||||
|
self.execute_do(self.prepare_do(False))
|
||||||
|
elif ViewControls.isUndoSelected():
|
||||||
|
SingleTransition.execute_undo(SingleTransition.prepare_undo(False))
|
||||||
|
elif ViewControls.isRedoSelected():
|
||||||
|
SingleTransition.execute_redo(SingleTransition.prepare_redo(False))
|
||||||
|
# if (ViewControls.undo_buffer < undoStackSize): do something
|
||||||
|
# ViewControls.setTimeBufferBar(ViewControls.undo_buffer)
|
||||||
|
# MainView.addElapsedTime() Clock should be independent from any view
|
||||||
|
|
||||||
|
def prepare_do(self, step_by_step) :
|
||||||
|
# ThreadsManager.addCycle() > nb_cycles ++ < no formula may be applied
|
||||||
|
selected_formula = FormulasManager.iterateToFindAFormula()
|
||||||
|
return selected_formula
|
||||||
|
|
||||||
|
def execute_do(self, formula_key):
|
||||||
|
# formula.doActions()
|
||||||
|
# print(" execute_do: formula key=" + formula_key +" ")
|
||||||
|
if formula_key < 0:
|
||||||
|
if StateManagerLocal.comment_origins:
|
||||||
|
print("execute_do failure: formula key=", formula_key)
|
||||||
|
return
|
||||||
|
|
||||||
|
MeasuresManager.startMeasuringAFormulaEffect(formula_key)
|
||||||
|
# print("execute_do "+ FormulasManager.formula.get(formula_key).name)
|
||||||
|
# TODO FormulasManager.getFormula().get(formula_key).doActions()
|
||||||
|
# for (i = 0 i < action.length i++): action[i].doAction ()
|
||||||
|
# StateManagerLocal.endRule(action_swap, action_name)}
|
||||||
|
MeasuresManager.endMeasuringAFormulaEffect(formula_key)
|
||||||
|
self.writePresentState(formula_key)
|
||||||
|
self.present += 1
|
||||||
|
if self.present == self.undoStackSize:
|
||||||
|
self.present = 0
|
||||||
|
# MainView.setStartStopButtonSelected(False)
|
||||||
|
# if (present == 1):
|
||||||
|
# MainView.setStartStopButtonSelected(False)
|
||||||
|
# out.println("MonoThread.execute_do > stop ! (present == 1)")
|
||||||
|
ViewControls.execDo()
|
||||||
|
# doRepaint()
|
||||||
|
if self.DO_UNDO_REDO_comment:
|
||||||
|
self.comment_do()
|
||||||
|
|
||||||
|
def prepare_undo(self, step_by_step):
|
||||||
|
# MonoTest.present-- return MonoTest.f[MonoTest.present]
|
||||||
|
if (ViewControls.isUndoBufferEmpty()):
|
||||||
|
print("prepare_undo stop !")
|
||||||
|
# undo_buffer is always >= 0
|
||||||
|
else:
|
||||||
|
self.present -= 1
|
||||||
|
if self.present == -1:
|
||||||
|
self.present = self.undoStackSize - 1
|
||||||
|
ViewControls.execUndo()
|
||||||
|
|
||||||
|
self.formula_key = self.readPresentState(step_by_step)
|
||||||
|
# if (step_by_step) StateManagerLocal.circlePresentState()
|
||||||
|
return self.formula_key
|
||||||
|
|
||||||
|
def execute_undo(self, formula_key):
|
||||||
|
# formula.unDoActions() {for (i = 0 i < action.length i++) ...}
|
||||||
|
FormulasManager.getFormula().get(formula_key).unDoActions()
|
||||||
|
# for (i = 0 i < action.length i++) action[i].doAction ()
|
||||||
|
# StateManagerLocal.endRule(action_swap, action_name)
|
||||||
|
ViewControls.setRedoSelected()
|
||||||
|
# StateManagerLocal.circlePresentState()
|
||||||
|
# ThreadsManager.removeEfficientCycle() {nb_effective_cycles --}
|
||||||
|
self.doRepaint()
|
||||||
|
if self.DO_UNDO_REDO_comment:
|
||||||
|
self.comment_undo()
|
||||||
|
|
||||||
|
def prepare_redo(self, step_by_step):
|
||||||
|
# return MonoThread
|
||||||
|
# Test.f[MonoThreadTest.pStateManagerLocalresent]
|
||||||
|
self.formula_key = self.readPresentState(step_by_step)
|
||||||
|
# ThreadsManager.addEfficientCycle() # {nb_effective_cycles ++}
|
||||||
|
# if (step_by_step) StateManagerLocal.circlePresentState()
|
||||||
|
return self.formula_key
|
||||||
|
|
||||||
|
def execute_redo(self, formula_key):
|
||||||
|
# formula.doActions() {for (i = 0 i < action.length i++) ...}
|
||||||
|
# the redo_buffer is always >= 0
|
||||||
|
# (if the re_do buffer is empty, the re_do button is deactivated)
|
||||||
|
if not ViewControls.isRedoBufferEmpty():
|
||||||
|
FormulasManager.getFormula().get(formula_key).doActions()
|
||||||
|
# {for (i = 0 i < action.length i++) action[i].doAction()
|
||||||
|
# StateManagerLocal.endRule(action_swap, action_name)}
|
||||||
|
self.present += 1
|
||||||
|
if self.present == self.undoStackSize:
|
||||||
|
self.present = 0
|
||||||
|
ViewControls.execRedo()
|
||||||
|
|
||||||
|
ViewControls.setUndoSelected()
|
||||||
|
self.doRepaint()
|
||||||
|
if self.DO_UNDO_REDO_comment:
|
||||||
|
self.comment_redo()
|
||||||
|
|
||||||
|
def writePresentState(self, formula_key):
|
||||||
|
# x[present] = StateManagerLocal.local_space_origin_X ...
|
||||||
|
self.formula[self.present] = formula_key
|
||||||
|
self.o[self.present] = StateManagerLocal.getReferenceOrientation_1()
|
||||||
|
'''
|
||||||
|
switch(StateManager.space_dimension) { # no break in this switch
|
||||||
|
case THREE: z[present] = (byte) StateManagerLocal.local_space_origin_Z
|
||||||
|
case TWO: y[present] = (byte) StateManagerLocal.local_space_origin_Y
|
||||||
|
case ONE: x[present] = (byte) StateManagerLocal.local_space_origin_X
|
||||||
|
default: }
|
||||||
|
'''
|
||||||
|
|
||||||
|
def readPresentState(self, step_by_step):
|
||||||
|
# StateManagerLocal.local_space_origin_X = x [present] ...
|
||||||
|
'''
|
||||||
|
switch(StateManager.space_dimension) { # no break in this switch
|
||||||
|
case THREE : StateManagerLocal.local_space_origin_Z = z[present]
|
||||||
|
case TWO : StateManagerLocal.local_space_origin_Y = y[present]
|
||||||
|
case ONE : StateManagerLocal.local_space_origin_X = x[present]
|
||||||
|
default: }
|
||||||
|
'''
|
||||||
|
StateManagerLocal.setReferenceOrientation_1(self.o[self.present])
|
||||||
|
return self.formula[self.present]
|
||||||
|
|
||||||
|
def doRepaint(self):
|
||||||
|
# plus tard !
|
||||||
|
# ViewsManagerAccess.getView(MODEL.SPACE, "MonoThread.",
|
||||||
|
# "execute_do_undo_redo()").repaint()
|
||||||
|
pass
|
||||||
|
|
||||||
|
def comment_do(self) :
|
||||||
|
if self.present == 0:
|
||||||
|
self.present = self.undoStackSize
|
||||||
|
print(" do -----> ", self.present,
|
||||||
|
" (", ViewControls.undo_buffer - 1,
|
||||||
|
"+1=", ViewControls.undo_buffer, " /",
|
||||||
|
ViewControls.redo_buffer,
|
||||||
|
" -", ViewControls.redo_buffer, ") xyzo (",
|
||||||
|
self.x[self.present - 1], ",",
|
||||||
|
self.y[self.present - 1], ",",
|
||||||
|
self.z[self.present - 1], ") ",
|
||||||
|
self.o[self.present - 1], " f=",
|
||||||
|
self.formula[self.present - 1])
|
||||||
|
if self.present == self.undoStackSize:
|
||||||
|
self.present = 0
|
||||||
|
|
||||||
|
def comment_undo(self):
|
||||||
|
# present ++ if (present == stack_size) present = 0
|
||||||
|
# This comment is triggered after present was decreased of one unit
|
||||||
|
print(" undo <--| ", self.present,
|
||||||
|
" (", (ViewControls.undo_buffer + 1),
|
||||||
|
"-1=", ViewControls.undo_buffer + " /",
|
||||||
|
ViewControls.redo_buffer - 1, "+1=",
|
||||||
|
ViewControls.redo_buffer, ") ", "xyzo (",
|
||||||
|
self.x[self.present], ",",
|
||||||
|
self.y[self.present], ",",
|
||||||
|
self.z[self.present], ") ",
|
||||||
|
self.o[self.present], " f=",
|
||||||
|
self.formula[self.present])
|
||||||
|
|
||||||
|
def comment_redo(self):
|
||||||
|
if self.present == 0:
|
||||||
|
self.present = self.undoStackSize
|
||||||
|
print(" redo |--> ", self.present,
|
||||||
|
" (" + (ViewControls.undo_buffer - 1),
|
||||||
|
"+1=" + ViewControls.undo_buffer + " /",
|
||||||
|
ViewControls.redo_buffer + 1, "-1=",
|
||||||
|
ViewControls.redo_buffer, ") xyzo (",
|
||||||
|
self.x[self.present - 1], ",",
|
||||||
|
self.y[self.present - 1], ",",
|
||||||
|
self.z[self.present - 1], ") ",
|
||||||
|
self.o[self.present - 1], " f=",
|
||||||
|
self.formula[self.present - 1])
|
||||||
|
if self.present == self.undoStackSize:
|
||||||
|
self.present = 0
|
||||||
|
|
||||||
|
|
||||||
|
SingleTransition()
|
|
@ -0,0 +1,18 @@
|
||||||
|
class XXX:
|
||||||
|
|
||||||
|
present = 8
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.present = 0
|
||||||
|
print(self.present,
|
||||||
|
'UnboundLocalError: local variable referenced before assignment')
|
||||||
|
|
||||||
|
def do_something(self):
|
||||||
|
# instance.present = 5
|
||||||
|
# self.present = 7
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
instance = XXX()
|
||||||
|
instance.do_something()
|
||||||
|
print(XXX.present, instance.present)
|
|
@ -0,0 +1,16 @@
|
||||||
|
glade_path = "/home/jean/Gem-Graph/gem-graph-client/ui/GLArea.glade"
|
||||||
|
modelPath = "/home/jean/Gem-Graph/gem-graph-client/models/dimers random walk.user.xml"
|
||||||
|
schemaPath = "/home/jean/Gem-Graph/gem-graph-client/schemas/models_0.2.1.xmls"
|
||||||
|
|
||||||
|
# les deux fichiers suivants pour me guider dans la fabrication d'un arbre "dynamique"
|
||||||
|
schemaExPath = "/home/jean/Gem-Graph/gem-graph-client/schemas/model_ex.xmls"
|
||||||
|
treeExPath = "/home/jean/Gem-Graph/gem-graph-client/ui/tree.ex"
|
||||||
|
|
||||||
|
|
||||||
|
# https://python-gtk-3-tutorial.readthedocs.io/en/latest/treeview.html#the-model
|
||||||
|
# https://python-gtk-3-tutorial.readthedocs.io/en/latest/builder.html
|
||||||
|
# https://python-gtk-3-tutorial.readthedocs.io/en/latest/objects.html
|
||||||
|
# https://anytree.readthedocs.io/en/latest/_modules/anytree/node/nodemixin.html
|
||||||
|
|
||||||
|
# from newick import loads
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
# ------------------------------------------------------------------------- #
|
||||||
|
# Client main file #
|
||||||
|
# #
|
||||||
|
# Copyright © 2021 The Gem-graph Project #
|
||||||
|
# #
|
||||||
|
# This file is part of gem-graph. #
|
||||||
|
# #
|
||||||
|
# This program is free software: you can redistribute it and/or modify #
|
||||||
|
# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU Affero General Public License #
|
||||||
|
# along with this program. If not, see <https:#www.gnu.org/licenses/>. #
|
||||||
|
# ------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
import gi
|
||||||
|
from anytree import RenderTree, LevelOrderIter
|
||||||
|
import rules_tree
|
||||||
|
import files_addr
|
||||||
|
gi.require_version("Gtk", "3.0")
|
||||||
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import GObject
|
||||||
|
|
||||||
|
def create_editable_tree(store, tree):
|
||||||
|
Gtk_node = [None] * 10
|
||||||
|
sketch = ''
|
||||||
|
nb = 0
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
if node.is_root:
|
||||||
|
Gtk_node[nb] = store.append(parent=None, row=[0, 'root ' + str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre + '᠇', ' node ' + str(node.id) + ' (root)\n')
|
||||||
|
else:
|
||||||
|
nb += 1
|
||||||
|
if node.is_leaf:
|
||||||
|
Gtk_node[nb] = store.append(parent = Gtk_node[node.parent.id],
|
||||||
|
row = [nb, str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre, str(node.id) + '\n')
|
||||||
|
else:
|
||||||
|
Gtk_node[nb] = store.append(parent = Gtk_node[node.parent.id],
|
||||||
|
row = [nb, 'node ' + str(node.id)])
|
||||||
|
sketch += u"%s%s" % (pre + '᠇', ' node' + str(node.id) + '\n')
|
||||||
|
sketch += "\n"
|
||||||
|
print(sketch)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Main window
|
||||||
|
|
||||||
|
store = Gtk.TreeStore(str, str)
|
||||||
|
|
||||||
|
tree = rules_tree.get_tree()
|
||||||
|
|
||||||
|
sketch = '------'
|
||||||
|
my_tree_store = Gtk.TreeStore(int, str)
|
||||||
|
create_editable_tree(my_tree_store, tree)
|
||||||
|
|
||||||
|
current_filter_button = None
|
||||||
|
language_filter = my_tree_store.filter_new()
|
||||||
|
|
||||||
|
treeview = Gtk.TreeView(model=language_filter)
|
||||||
|
for i, column_title in enumerate(["Row", "Path"]):
|
||||||
|
renderer = Gtk.CellRendererText()
|
||||||
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
||||||
|
treeview.append_column(column)
|
||||||
|
|
||||||
|
scrollable_treelist = Gtk.ScrolledWindow()
|
||||||
|
scrollable_treelist.add(treeview)
|
||||||
|
|
||||||
|
tree_viewport = Gtk.Viewport()
|
||||||
|
tree_viewport.add(scrollable_treelist)
|
||||||
|
tree_viewport.set_size_request(300, 200)
|
||||||
|
|
||||||
|
builder = Gtk.Builder()
|
||||||
|
builder.add_from_file(files_addr.glade_path)
|
||||||
|
|
||||||
|
transit = builder.get_object("Id_Transitions")
|
||||||
|
transit.set_label(sketch)
|
||||||
|
|
||||||
|
transit.add(tree_viewport)
|
||||||
|
|
||||||
|
window = builder.get_object("GemGraphMainWindow")
|
||||||
|
# window.show_all()
|
||||||
|
|
||||||
|
"""
|
||||||
|
treestr = ''
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
treestr = u"%s%s" % (pre, node.id)
|
||||||
|
treestr += treestr + "\n"
|
||||||
|
"""
|
|
@ -0,0 +1,498 @@
|
||||||
|
from lxml import etree
|
||||||
|
import datetime as DT
|
||||||
|
import files_addr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Identity
|
||||||
|
|
||||||
|
|
||||||
|
class G_ref:
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
|
||||||
|
def get_id(self):
|
||||||
|
return self.node.get("id")
|
||||||
|
|
||||||
|
def set_id(self, id):
|
||||||
|
self.node.attrib["id"] = id
|
||||||
|
|
||||||
|
def get_author(self):
|
||||||
|
return self.node.get("author")
|
||||||
|
|
||||||
|
def set_author(self, author):
|
||||||
|
self.node.attrib["author"] = author
|
||||||
|
|
||||||
|
def get_date(self):
|
||||||
|
return DT.datetime.fromtimestamp(int(self.node.get("date")))
|
||||||
|
|
||||||
|
def set_date(self, date):
|
||||||
|
self.node.attrib["date"] = str(int(date.timestamp()))
|
||||||
|
|
||||||
|
def get_lang(self):
|
||||||
|
return self.node.get("lang")
|
||||||
|
|
||||||
|
def set_lang(self, lang):
|
||||||
|
if(len(lang) > 2):
|
||||||
|
print("lang must be 2 characters")
|
||||||
|
return
|
||||||
|
self.node.attrib["lang"] = lang
|
||||||
|
|
||||||
|
def get_text(self):
|
||||||
|
return self.node.textdimension().get_axis
|
||||||
|
|
||||||
|
def set_text(self, text):
|
||||||
|
self.node.text = text
|
||||||
|
|
||||||
|
|
||||||
|
class Identity:
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "name"):
|
||||||
|
self.__name = child
|
||||||
|
if(child.tag == "owner"):
|
||||||
|
self.__owner = child
|
||||||
|
if(child.tag == "owner_id"):
|
||||||
|
self.__owner_id = child
|
||||||
|
if(child.tag == "date"):
|
||||||
|
self.__date = child
|
||||||
|
if(child.tag == "version"):
|
||||||
|
self.__version = child
|
||||||
|
if(child.tag == "g_ref"):
|
||||||
|
self.__g_ref = child
|
||||||
|
|
||||||
|
def get_g_ref(self):
|
||||||
|
return G_ref(self.__g_ref)
|
||||||
|
|
||||||
|
def get_name(self):
|
||||||
|
return self.__name.text
|
||||||
|
|
||||||
|
def set_name(self, text):
|
||||||
|
self.__name.text = text
|
||||||
|
|
||||||
|
def get_owner(self):
|
||||||
|
return self.__owner.text
|
||||||
|
|
||||||
|
def set_owner(self, text):
|
||||||
|
self.__owner.text = text
|
||||||
|
|
||||||
|
def get_owner_id(self):
|
||||||
|
return self.__owner_id.text
|
||||||
|
|
||||||
|
def set_owner_id(self, text):
|
||||||
|
self.__owner_id.text = text
|
||||||
|
|
||||||
|
def get_date(self):
|
||||||
|
return DT.datetime.fromtimestamp(int(self.__date.text))
|
||||||
|
|
||||||
|
def set_date(self, date):
|
||||||
|
self.__date.text = str(int(date.timestamp()))
|
||||||
|
|
||||||
|
def get_version(self):
|
||||||
|
return self.__version.text
|
||||||
|
|
||||||
|
def set_version(self, text):
|
||||||
|
self.__version.text = text
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
|
||||||
|
class Simulation:
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "max_thread"):
|
||||||
|
self.__max_thread = child
|
||||||
|
if(child.tag == "max_cycles"):
|
||||||
|
self.__max_cycles = child
|
||||||
|
|
||||||
|
def get_max_thread(self):
|
||||||
|
return int(self.__max_thread.text)
|
||||||
|
|
||||||
|
def set_max_thread(self, value):
|
||||||
|
if(not isinstance(value, int)):
|
||||||
|
print("max_thread must be an int")
|
||||||
|
return
|
||||||
|
self.__max_thread.text = str(value)
|
||||||
|
|
||||||
|
def get_max_cycles(self):
|
||||||
|
return int(self.__max_cycles.text)
|
||||||
|
|
||||||
|
def set_max_cycles(self, value):
|
||||||
|
if(not isinstance(value, int)):
|
||||||
|
print("max_cycles must be an int")
|
||||||
|
return
|
||||||
|
self.__max_cycles.text = str(value)
|
||||||
|
|
||||||
|
|
||||||
|
class Spaceparam:
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "dimension"):
|
||||||
|
self.__dimension = Dimension(child)
|
||||||
|
if(child.tag == "site_multiplicity"):
|
||||||
|
self.__site_multiplicity = child
|
||||||
|
|
||||||
|
def get_site_multiplicity(self):
|
||||||
|
return self.__site_multiplicity.text
|
||||||
|
|
||||||
|
def set_site_multiplicity(self, value):
|
||||||
|
self.__site_multiplicity.text = str(value)
|
||||||
|
|
||||||
|
def get_dimension(self):
|
||||||
|
return self.__dimension
|
||||||
|
|
||||||
|
def set_dimension(self, value):
|
||||||
|
self.__dimension = str(value) # TODO Assert
|
||||||
|
|
||||||
|
|
||||||
|
class Axis:
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
|
||||||
|
def get_name(self):
|
||||||
|
return self.node.attrib["name"]
|
||||||
|
|
||||||
|
def set_name(self, value):
|
||||||
|
pass # TODO (The user can create a complete model from scratch.)
|
||||||
|
|
||||||
|
def get_size(self):
|
||||||
|
return int(self.node.attrib["size"])
|
||||||
|
|
||||||
|
def set_size(self, value):
|
||||||
|
pass # TODO (The user can create a complete model from scratch.)
|
||||||
|
|
||||||
|
|
||||||
|
class Dimension:
|
||||||
|
__axis = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
|
||||||
|
def get_x(self):
|
||||||
|
return int(self.node.get("x"))
|
||||||
|
|
||||||
|
def set_x(self, value):
|
||||||
|
self.node.attrib["x"] = value # TODO Assert
|
||||||
|
|
||||||
|
def get_y(self):
|
||||||
|
return int(self.node.get("y"))
|
||||||
|
|
||||||
|
def set_y(self, value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# TODO z, u, v, w,...
|
||||||
|
|
||||||
|
|
||||||
|
class Parameters:
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "simulation"):
|
||||||
|
self.simulation = Simulation(child)
|
||||||
|
if(child.tag == "space-param"):
|
||||||
|
self.spaceparam = Spaceparam(child)
|
||||||
|
|
||||||
|
def get_id(self):
|
||||||
|
return self.node.attrib["id"]
|
||||||
|
|
||||||
|
def set_id(self, text):
|
||||||
|
self.node.attrib["id"] = text
|
||||||
|
|
||||||
|
def get_author(self):
|
||||||
|
return self.node.attrib["author"]
|
||||||
|
|
||||||
|
def set_author(self, text):
|
||||||
|
self.node.attrib["author"] = text
|
||||||
|
|
||||||
|
def get_date(self):
|
||||||
|
return self.node.attrib["date"]
|
||||||
|
|
||||||
|
def set_date(self, text):
|
||||||
|
self.node.attrib["date"] = text
|
||||||
|
|
||||||
|
## Objects
|
||||||
|
|
||||||
|
|
||||||
|
class Object:
|
||||||
|
|
||||||
|
__arrows = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "arrow"):
|
||||||
|
self.__arrows.append(Arrow(child))
|
||||||
|
|
||||||
|
def get_arrow(self, i):
|
||||||
|
return self.__arrows[i]
|
||||||
|
|
||||||
|
def set_arrow(self, i, value):
|
||||||
|
self.__arrows[i] = value # TODO Assert
|
||||||
|
|
||||||
|
|
||||||
|
class Objects:
|
||||||
|
__objects = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "object"):
|
||||||
|
self.__objects.append(Object(child))
|
||||||
|
|
||||||
|
def get_object(self, i):
|
||||||
|
return self.__objects[i]
|
||||||
|
|
||||||
|
def set_object(self, i, Object):
|
||||||
|
self.__objects[i] = Object # TODO Assert
|
||||||
|
|
||||||
|
|
||||||
|
## States
|
||||||
|
|
||||||
|
|
||||||
|
class Space:
|
||||||
|
__arrows = []
|
||||||
|
nb_occupied_sites = 0
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "arrow"):
|
||||||
|
self.nb_occupied_sites += 1
|
||||||
|
self.__arrows.append(Arrow(child))
|
||||||
|
|
||||||
|
def get_arrow(self, i):
|
||||||
|
return self.__arrows[i]
|
||||||
|
|
||||||
|
def get_nb_occupied_sites(self):
|
||||||
|
return self.nb_occupied_sites
|
||||||
|
|
||||||
|
def get_weight(self, cell, site):
|
||||||
|
return 4096
|
||||||
|
|
||||||
|
|
||||||
|
class States:
|
||||||
|
__space = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "space"):
|
||||||
|
self.__space.append(Space(child))
|
||||||
|
|
||||||
|
def get_space(self, i):
|
||||||
|
return self.__space[i]
|
||||||
|
|
||||||
|
|
||||||
|
## Conditions Tree
|
||||||
|
|
||||||
|
class TreeNode(object):
|
||||||
|
|
||||||
|
def __init__(self, id, parent, x, site, weight):
|
||||||
|
self.id = id
|
||||||
|
self.parent = parent
|
||||||
|
self.ch = []
|
||||||
|
self.x = x
|
||||||
|
# TODO self.y = y,...
|
||||||
|
self.site = site
|
||||||
|
self.weight = weight
|
||||||
|
|
||||||
|
def id(self):
|
||||||
|
return id
|
||||||
|
|
||||||
|
def add_child(self, ch_id):
|
||||||
|
self.ch.append(ch_id)
|
||||||
|
self.ch = sorted(self.ch, key=id)
|
||||||
|
|
||||||
|
|
||||||
|
## Conditions
|
||||||
|
|
||||||
|
|
||||||
|
class Condition:
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
|
||||||
|
def get_coord(self, axis):
|
||||||
|
# print(self.node.get(axis))
|
||||||
|
return int(self. node.get(axis))
|
||||||
|
|
||||||
|
def set_coord(self, axis, value):
|
||||||
|
self.node.attrib[axis] = str(value)
|
||||||
|
|
||||||
|
def get_site(self):
|
||||||
|
return int(self.node.get("site"))
|
||||||
|
|
||||||
|
def set_site(self, site):
|
||||||
|
self.node.attrib["site"] = str(site)
|
||||||
|
|
||||||
|
def get_weight(self):
|
||||||
|
return int(self.node.get("weight"))
|
||||||
|
|
||||||
|
def set_weight(self, weight):
|
||||||
|
self.node.attrib["weight"] = str(weight)
|
||||||
|
|
||||||
|
def get_self_id(self):
|
||||||
|
return int(self.node.get("node_id"))
|
||||||
|
|
||||||
|
def set_self_id(self, node_id):
|
||||||
|
self.node.attrib["node_id"] = str(node_id)
|
||||||
|
|
||||||
|
def get_parent_id(self):
|
||||||
|
return int(self.node.get("parent"))
|
||||||
|
|
||||||
|
def set_parent_id(self, parent):
|
||||||
|
self.node.attrib["parent"] = str(parent)
|
||||||
|
|
||||||
|
|
||||||
|
class Conditions:
|
||||||
|
__conditions = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "condition"):
|
||||||
|
self.__conditions.append(Condition(child))
|
||||||
|
|
||||||
|
def get_one(self, i):
|
||||||
|
return self.__conditions[i]
|
||||||
|
|
||||||
|
def get_all(self):
|
||||||
|
return self.__conditions
|
||||||
|
|
||||||
|
|
||||||
|
class Transition:
|
||||||
|
__arrows = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "arrow"):
|
||||||
|
self.__arrows.append(Arrow(child))
|
||||||
|
|
||||||
|
def get_id(self):
|
||||||
|
return self.node.attrib["id"]
|
||||||
|
|
||||||
|
def get_date(self):
|
||||||
|
return self.node.attrib["date"]
|
||||||
|
|
||||||
|
def get_author(self):
|
||||||
|
return self.node.attrib["author"]
|
||||||
|
|
||||||
|
def get_parent_id(self):
|
||||||
|
return self.node.attrib["parent"]
|
||||||
|
|
||||||
|
def get_probability(self):
|
||||||
|
return self.node.attrib["probability"]
|
||||||
|
|
||||||
|
def get_arrow(self, i):
|
||||||
|
return self.__arrows[i]
|
||||||
|
|
||||||
|
|
||||||
|
class Transitions:
|
||||||
|
__transitions = []
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
for child in node:
|
||||||
|
if(child.tag == "transition"):
|
||||||
|
self.__transitions.append(Transition(child))
|
||||||
|
|
||||||
|
def get_one(self, i):
|
||||||
|
return self.__transitions[i]
|
||||||
|
|
||||||
|
def get_all(self):
|
||||||
|
return self.__transitions
|
||||||
|
|
||||||
|
|
||||||
|
## Model
|
||||||
|
|
||||||
|
|
||||||
|
class Arrow:
|
||||||
|
|
||||||
|
def __init__(self, node):
|
||||||
|
self.node = node
|
||||||
|
|
||||||
|
def get_coord(self, axis):
|
||||||
|
return int(self.node.get(axis))
|
||||||
|
|
||||||
|
def set_coord(self, axis, value):
|
||||||
|
self.node.attrib[axis] = str(value)
|
||||||
|
|
||||||
|
def get_site(self):
|
||||||
|
return int(self.node.get("site"))
|
||||||
|
|
||||||
|
def set_site(self, site):
|
||||||
|
self.node.attrib["site"] = str(site)
|
||||||
|
|
||||||
|
def get_weight(self):
|
||||||
|
return int(self.node.get("weight"))
|
||||||
|
|
||||||
|
def set_weight(self, weight):
|
||||||
|
self.node.attrib["weight"] = str(weight)
|
||||||
|
|
||||||
|
|
||||||
|
class Model:
|
||||||
|
|
||||||
|
def __init__(self, modelpath, schemapath):
|
||||||
|
schema = etree.parse(schemapath)
|
||||||
|
xmlschema = etree.XMLSchema(schema)
|
||||||
|
self.parser = etree.XMLParser(
|
||||||
|
remove_blank_text=True,
|
||||||
|
remove_pis=True,
|
||||||
|
compact=True,
|
||||||
|
schema=xmlschema)
|
||||||
|
self.tree = etree.parse(modelpath, self.parser)
|
||||||
|
self.node = self.tree.getroot()
|
||||||
|
self.create_all_leaves()
|
||||||
|
|
||||||
|
def create_all_leaves(self):
|
||||||
|
for child in self.node:
|
||||||
|
if(isinstance(child.tag, str)):
|
||||||
|
if(child.tag == "identity"):
|
||||||
|
self.__identity = child
|
||||||
|
if(child.tag == "parameters"):
|
||||||
|
self.__parameters = child
|
||||||
|
if(child.tag == "objects"):
|
||||||
|
self.__objects = child
|
||||||
|
if(child.tag == "states"):
|
||||||
|
self.__states = child
|
||||||
|
if(child.tag == "conditions"):
|
||||||
|
self.__conditions = child
|
||||||
|
if(child.tag == "transitions"):
|
||||||
|
self.__transitions = child
|
||||||
|
|
||||||
|
def get_space(self, space_id, x_val, site_val):
|
||||||
|
pass
|
||||||
|
# return testmodel.get_states().get_space(space_id).
|
||||||
|
# get_weight(x_val, site_val)
|
||||||
|
|
||||||
|
def get_identity(self):
|
||||||
|
return Identity(self.__identity)
|
||||||
|
|
||||||
|
def get_parameters(self):
|
||||||
|
return Parameters(self.__parameters)
|
||||||
|
|
||||||
|
def get_objects(self):
|
||||||
|
return Objects(self.__objects)
|
||||||
|
|
||||||
|
def get_states(self):
|
||||||
|
return States(self.__states)
|
||||||
|
|
||||||
|
def get_tree(self):
|
||||||
|
return self.tree
|
||||||
|
|
||||||
|
def get_conditions(self):
|
||||||
|
return Conditions(self.__conditions)
|
||||||
|
|
||||||
|
def get_transitions(self):
|
||||||
|
return Transitions(self.__transitions)
|
||||||
|
|
||||||
|
def save_as(self, name):
|
||||||
|
self.tree.write("../models/" + name + ".xml", encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
|
testmodel = Model(files_addr.modelPath, files_addr.schemaPath)
|
|
@ -0,0 +1,18 @@
|
||||||
|
# https://evolution.genetics.washington.edu/phylip/newicktree.html
|
||||||
|
# import io
|
||||||
|
import newick
|
||||||
|
# from newick import loads
|
||||||
|
|
||||||
|
tree = newick.loads('(b,(c,(d,(e,(f,g))h)i)a)')[0]
|
||||||
|
|
||||||
|
print(tree.ascii_art())
|
||||||
|
'''
|
||||||
|
from newick import loads
|
||||||
|
|
||||||
|
newick.loads('[a comment](a,b)c;', strip_comments=True)[0].newick '(a,b)c'
|
||||||
|
|
||||||
|
with io.open('../models/newick_first', encoding='utf8') as fp:
|
||||||
|
trees = loads(fp)
|
||||||
|
print(tree.ascii_art())
|
||||||
|
print(trees[0].name, [n.name for n in trees[0].descendants])
|
||||||
|
'''
|
|
@ -0,0 +1,69 @@
|
||||||
|
from anytree import NodeMixin, LevelOrderIter, RenderTree
|
||||||
|
import model
|
||||||
|
|
||||||
|
|
||||||
|
# TODO Contrôles de cohérence des données
|
||||||
|
# 1) node_id <> pas de doublons
|
||||||
|
# 2) tout node doit avoir un node_parent_id (assess 'is_node' ?)
|
||||||
|
# Process
|
||||||
|
# 1) lors de l'adoption, le parent doit être une feuille et exister
|
||||||
|
|
||||||
|
|
||||||
|
class TreeNode(NodeMixin):
|
||||||
|
def __init__(self, id, parent_id, weight, site, x, y, z):
|
||||||
|
super(TreeNode, self).__init__()
|
||||||
|
self.id = id
|
||||||
|
self.enonce = str(id)
|
||||||
|
self.parent_id = parent_id
|
||||||
|
self.parent = None
|
||||||
|
self.weight = weight
|
||||||
|
self.site = site
|
||||||
|
self.x = x
|
||||||
|
self.y = y
|
||||||
|
self.z = z
|
||||||
|
|
||||||
|
def is_adopted_by(self, parent_node):
|
||||||
|
self.parent = parent_node
|
||||||
|
# print('orphan node ', self.id, ' is adopted by node ', parent_node.id)
|
||||||
|
|
||||||
|
|
||||||
|
conditions_set = set()
|
||||||
|
transitions_set = set()
|
||||||
|
root = None
|
||||||
|
|
||||||
|
for i in range(0, len(model.testmodel.get_conditions().get_all())):
|
||||||
|
condition = model.testmodel.get_conditions().get_one(i)
|
||||||
|
tmp = TreeNode(condition.get_self_id(),
|
||||||
|
condition.get_parent_id(),
|
||||||
|
condition.get_weight(),
|
||||||
|
condition.get_site(),
|
||||||
|
condition.get_coord("x"),
|
||||||
|
None, None)
|
||||||
|
conditions_set.add(tmp)
|
||||||
|
if tmp.parent_id == 0:
|
||||||
|
root = tmp
|
||||||
|
|
||||||
|
for i in range(0, len(model.testmodel.get_transitions().get_all())):
|
||||||
|
transition = model.testmodel.get_transitions().get_one(i)
|
||||||
|
transitions_set.add(TreeNode(
|
||||||
|
transition.get_id(),
|
||||||
|
transition.get_parent_id(),
|
||||||
|
None, None, None, None, None))
|
||||||
|
|
||||||
|
for i in conditions_set:
|
||||||
|
for j in conditions_set:
|
||||||
|
if (i != j) & (i.parent_id == j.id):
|
||||||
|
i.is_adopted_by(j)
|
||||||
|
|
||||||
|
for condition_node in LevelOrderIter(root):
|
||||||
|
if condition_node.is_leaf:
|
||||||
|
for transition_node in transitions_set:
|
||||||
|
if str(condition_node.id) == transition_node.parent_id:
|
||||||
|
transition_node.is_adopted_by(condition_node)
|
||||||
|
|
||||||
|
|
||||||
|
## get the tree
|
||||||
|
|
||||||
|
|
||||||
|
def get_tree():
|
||||||
|
return root
|
|
@ -0,0 +1,7 @@
|
||||||
|
uniform vec2 resolution;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_FragColor = vec4(gl_FragCoord.x / resolution.x,1,1,1);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = ftransform();
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
"""
|
||||||
|
STRUCTURES DE DONNÉES
|
||||||
|
|
||||||
|
1) STOCKAGE
|
||||||
|
--------
|
||||||
|
- XML
|
||||||
|
Chaque espace est stocké sous forme d'une séquence d'arrows.
|
||||||
|
Chaque arrow associe
|
||||||
|
- les coordonnées d'une cellule,
|
||||||
|
- le n° d'un site, et
|
||||||
|
- un 'poids', égal au nombre de flèches présentes dans ce site.
|
||||||
|
|
||||||
|
Seuls les sites contenant des flèches sont mentionnés dans cette séquence.
|
||||||
|
Par convention, les autres sites sont supposés vides.
|
||||||
|
|
||||||
|
2) TRAVAIL
|
||||||
|
-------
|
||||||
|
- si la taille de l'espace est constante,
|
||||||
|
et le nombre maximal de flèches par site peu élevé,
|
||||||
|
alors, l'espace peut être représenté par une string
|
||||||
|
sinon par une liste.
|
||||||
|
|
||||||
|
- Le but de ces structure est:
|
||||||
|
* la visualisation (lors de l'exécution des transitions et des undo/redo).
|
||||||
|
* l'édition de l'espace.
|
||||||
|
|
||||||
|
DISCUSSION
|
||||||
|
|
||||||
|
Les éléments d'interêt pour le moteur graphique
|
||||||
|
sont dans le tableau des sites contenant des flèches.
|
||||||
|
Ce tableau est créé par lxml lors de la lecture (parsing) du fichier XML.
|
||||||
|
Il est lu / écrit par des fonctions en C
|
||||||
|
qui peuvent aller d'une case à l'autre par de simples additions.
|
||||||
|
|
||||||
|
Cependant, ce tableau ne répertorie que les sites occupés.
|
||||||
|
Pour qu'il puisse être accédé rapidement, il faut l'indexer.
|
||||||
|
|
||||||
|
Puis, pour construire une image, il faut calculer la localisation de
|
||||||
|
chaque point occupé de l'image à partir des coordonnées de chaque site occupé.
|
||||||
|
NB Les sites non mentionnés dans ce tableau sont supposés vides.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Dans le cas d'un espace de taille constante (cas le plus fréquent),
|
||||||
|
un tableau de tout l'espace (et pas seulement des sites occupés) permettrait
|
||||||
|
d'accéder au contenu de chaque site en une seule étape, par un calcul simple
|
||||||
|
identique à celui effectué pour produire l'image.
|
||||||
|
|
||||||
|
Cette représentation pourrait améliorer la lisibilité des algorithmes d'édition.
|
||||||
|
NB Lors de l'édition, aucune optimisation graphique n'est nécessaire.
|
||||||
|
|
||||||
|
|
||||||
|
Si un deuxième tableau est utilisé,
|
||||||
|
alors, des recopies périodiques dans le tableau lxml seront nécessaires.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import model
|
||||||
|
|
||||||
|
sp = model.testmodel.get_states().get_space(0)
|
||||||
|
size = model.testmodel.get_parameters().spaceparam.get_dimension().get_x()
|
||||||
|
sites = int(model.testmodel.get_parameters().spaceparam.get_site_multiplicity())
|
||||||
|
occupied = int(model.testmodel.get_states().get_space(0).nb_occupied_sites)
|
||||||
|
|
||||||
|
|
||||||
|
print("\nspace size =", size, " nb de sites par cellule =", sites,
|
||||||
|
" nb de sites occupés dans l'ensemble de l' l'espace =",
|
||||||
|
occupied, end='\n')
|
||||||
|
|
||||||
|
view = ' | '
|
||||||
|
|
||||||
|
# TODO Contrôles de cohérence des données
|
||||||
|
# condition et arrow
|
||||||
|
# 1) weight < weight_max (à définir)
|
||||||
|
# 2) arrow.site < site_multiplicity
|
||||||
|
# 3) arrow.x < space-param.dimension.x (idem autres axes)
|
||||||
|
# condition
|
||||||
|
# 1) parent <= condition.node_id max value (donc deux lectures)
|
||||||
|
# 2) pas de node sans un node_parent_id
|
||||||
|
|
||||||
|
|
||||||
|
coord = ' ' * sites + ' '
|
||||||
|
|
||||||
|
for n in range(0, size + 1):
|
||||||
|
for s in range(0, sites):
|
||||||
|
arr = 0
|
||||||
|
for a in range(0, occupied):
|
||||||
|
if (
|
||||||
|
sp.get_arrow(a).get_coord("x") == n
|
||||||
|
and sp.get_arrow(a).get_site() == s
|
||||||
|
):
|
||||||
|
arr = sp.get_arrow(a).get_weight()
|
||||||
|
if arr > 0:
|
||||||
|
view += str(arr) + ' '
|
||||||
|
else:
|
||||||
|
view += '. '
|
||||||
|
|
||||||
|
view += ' | '
|
||||||
|
|
||||||
|
if n < 10:
|
||||||
|
coord += str(n) + ' ' + ' ' * sites * 2
|
||||||
|
else:
|
||||||
|
coord += str(n) + ' ' + ' ' * sites * 2
|
||||||
|
|
||||||
|
print(view)
|
||||||
|
print(coord)
|
|
@ -0,0 +1,29 @@
|
||||||
|
from anytree import RenderTree
|
||||||
|
import rules_tree
|
||||||
|
|
||||||
|
tree = rules_tree.get_tree()
|
||||||
|
|
||||||
|
any_node = tree.children[1].children[0]
|
||||||
|
print('\nproperties of node: ', any_node.id)
|
||||||
|
print('type: ', type(any_node))
|
||||||
|
print('len(path): ', len(any_node.path))
|
||||||
|
print('nb children: ', len(any_node.children))
|
||||||
|
# print('descendants[0]: ', any_node.descendants[0])
|
||||||
|
print('depth ', any_node.depth)
|
||||||
|
print('is_leaf ', any_node.is_leaf)
|
||||||
|
print('is_root ', any_node.is_root)
|
||||||
|
print('height ', any_node.height)
|
||||||
|
print('parent ', any_node.parent)
|
||||||
|
print('nb ancestors ', len(any_node.ancestors))
|
||||||
|
print('nb anchestors ', len(any_node.anchestors))
|
||||||
|
print('siblings ', any_node.siblings)
|
||||||
|
print('nb (subtree.leaves) ', len(any_node.leaves), '\n')
|
||||||
|
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
if node.path[len(node.path) - 1].is_leaf:
|
||||||
|
print('at depth', len(node.path),
|
||||||
|
'is rule', node.path[len(node.path) - 1].parent_id,
|
||||||
|
'whose path (tracked by conditions weights) is:', end=' ')
|
||||||
|
for i in range(0, len(node.path) - 1):
|
||||||
|
print(node.path[i].weight, ',', end='')
|
||||||
|
print(' transition is:', node.path[len(node.path) - 1].id)
|
|
@ -0,0 +1,42 @@
|
||||||
|
|
||||||
|
# from ete2 import Tree
|
||||||
|
from anytree import RenderTree
|
||||||
|
import rules_tree
|
||||||
|
|
||||||
|
tree = rules_tree.get_tree()
|
||||||
|
|
||||||
|
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
treestr = u"%s%s" % (pre, node.id)
|
||||||
|
print(treestr.ljust(0))
|
||||||
|
'''
|
||||||
|
any_node = tree.children[1].children[0].children[0]
|
||||||
|
print('\nproperties of node: ', any_node.id)
|
||||||
|
print('type: ', type(any_node))
|
||||||
|
print('len(path): ', len(any_node.path))
|
||||||
|
print('nb children: ', len(any_node.children))
|
||||||
|
print('descendants[0]: ', any_node.descendants[0])
|
||||||
|
print('depth ', any_node.depth)
|
||||||
|
print('is_leaf ', any_node.is_leaf)
|
||||||
|
print('is_root ', any_node.is_root)
|
||||||
|
print('height ', any_node.height)
|
||||||
|
print('parent ', any_node.parent)
|
||||||
|
print('nb ancestors ', len(any_node.ancestors))
|
||||||
|
print('nb anchestors ', len(any_node.anchestors))
|
||||||
|
print('siblings ', any_node.siblings)
|
||||||
|
print('nb (subtree.leaves) ', len(any_node.leaves), '\n')
|
||||||
|
'''
|
||||||
|
'''
|
||||||
|
print()
|
||||||
|
for pre, fill, node in RenderTree(tree):
|
||||||
|
if node.path[len(node.path) - 1].is_leaf:
|
||||||
|
print('at depth', len(node.path),
|
||||||
|
'is rule', node.path[len(node.path) - 1].parent_id,
|
||||||
|
'whose path (tracked by conditions weights) is:', end=' ')
|
||||||
|
for i in range(0, len(node.path) - 1):
|
||||||
|
print(node.path[i].weight, ',', end='')
|
||||||
|
print(' transition is:', node.path[len(node.path) - 1].id)
|
||||||
|
|
||||||
|
print('\nNext step: learn how to use the Newick format.')
|
||||||
|
# http://etetoolkit.org/docs/2.3/tutorial/tutorial_trees.html
|
||||||
|
'''
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<interface>
|
||||||
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
|
<object class="GtkWindow" id="window1">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button1">
|
||||||
|
<property name="label" translatable="yes">button</property>
|
||||||
|
<property name="use-action-appearance">False</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
|
@ -0,0 +1,226 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.2 -->
|
||||||
|
<!-- This file is temporary and meant to test graphic features -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<object class="GtkWindow" id="GemGraphMainWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="hexpand">False</property>
|
||||||
|
<property name="vexpand">False</property>
|
||||||
|
<property name="window-position">center</property>
|
||||||
|
<property name="default-width">1000</property> <!-- 1400 -->
|
||||||
|
<property name="default-height">500</property>
|
||||||
|
<property name="gravity">static</property>
|
||||||
|
<property name="has-resize-grip">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">tout ce qui est sous la 'header bar'</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">Image 1D + contrôles</property>
|
||||||
|
<property name="height-request">100</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="height-request">60</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="margin-start">1</property>
|
||||||
|
<property name="margin-end">1</property>
|
||||||
|
<property name="margin-top">1</property>
|
||||||
|
<property name="margin-bottom">1</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="pixbuf">espace 1D projet.jpg</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="height-request">32</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Zoom</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Filtres</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Apparences</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">tout ce qui est sous l'image 1D et ses contrôles</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="Id_Transitions">
|
||||||
|
<property name="label" translatable="yes">transitions </property>
|
||||||
|
<property name="width-request">400</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">objets</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="titlebar">
|
||||||
|
<object class="GtkHeaderBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="can-default">True</property>
|
||||||
|
<property name="tooltip-text" translatable="yes">Salut ! Je suis la nouvelle barre de commandes.</property>
|
||||||
|
<property name="title" translatable="yes">Gem-graph</property>
|
||||||
|
<property name="has-subtitle">False</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">utilisateur (préférences)</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToggleButton" id="mon_bouton">
|
||||||
|
<property name="label" translatable="yes">modèle (load / save)</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<signal name="toggled" handler="tilt" object="__glade_Hi" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">états / transitions</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">monitoring et contrôles / éditions</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
|
@ -0,0 +1,226 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.38.2 -->
|
||||||
|
<!-- This file is temporary and meant to test graphic features -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.24"/>
|
||||||
|
<object class="GtkWindow">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="hexpand">False</property>
|
||||||
|
<property name="vexpand">False</property>
|
||||||
|
<property name="window-position">center</property>
|
||||||
|
<property name="default-width">1860</property>
|
||||||
|
<property name="default-height">160</property>
|
||||||
|
<property name="gravity">static</property>
|
||||||
|
<property name="has-resize-grip">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">tout ce qui est sous la 'header bar'</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">Image 1D + contrôles</property>
|
||||||
|
<property name="height-request">100</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkScrolledWindow">
|
||||||
|
<property name="height-request">60</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="shadow-type">in</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkViewport">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="margin-start">1</property>
|
||||||
|
<property name="margin-end">1</property>
|
||||||
|
<property name="margin-top">1</property>
|
||||||
|
<property name="margin-bottom">1</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="pixbuf">espace 1D projet.jpg</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="height-request">32</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="halign">center</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Zoom</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Filtres</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">Apparences</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkPaned">
|
||||||
|
<property name="name">tout ce qui est sous l'image 1D et ses contrôles</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">transitions </property>
|
||||||
|
<property name="width-request">700</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">False</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">objets</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="titlebar">
|
||||||
|
<object class="GtkHeaderBar">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="can-default">True</property>
|
||||||
|
<property name="tooltip-text" translatable="yes">Salut ! Je suis la nouvelle barre de commandes.</property>
|
||||||
|
<property name="title" translatable="yes">Gem-graph</property>
|
||||||
|
<property name="has-subtitle">False</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<property name="show-close-button">True</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">False</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">utilisateur (préférences)</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToggleButton" id="mon_bouton">
|
||||||
|
<property name="label" translatable="yes">modèle (load / save)</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
<signal name="toggled" handler="tilt" object="__glade_Hi" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">états / transitions</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="label" translatable="yes">monitoring et contrôles / éditions</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can-focus">True</property>
|
||||||
|
<property name="receives-default">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</interface>
|
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<root version="0.2.1">
|
||||||
|
<p rank="0" id="0" pp="0">condition 0 = ROOT</p>
|
||||||
|
<p rank="0" id="1" pp="0">condition 1</p>
|
||||||
|
<p rank="0" id="2" pp="1">condition 2</p>
|
||||||
|
<p rank="1" id="3" pp="1">condition 3</p>
|
||||||
|
<p rank="0" id="E" pp="2">move_a_dimer_to_east</p>
|
||||||
|
<p rank="0" id="W" pp="3">move_a_dimer_to_west</p>
|
||||||
|
</root>
|
Loading…
Reference in New Issue