Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
biocham
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Lifeware
biocham
Commits
50805643
Commit
50805643
authored
Oct 16, 2015
by
SOLIMAN Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use annotations to store compiled form of conservations
parent
3754983f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
conservation_laws.pl
conservation_laws.pl
+8
-4
conservation_laws.plt
conservation_laws.plt
+5
-4
No files found.
conservation_laws.pl
View file @
50805643
...
...
@@ -31,15 +31,16 @@ add_conservation(Conservation) :-
a warning.'
),
solution_to_conservation
(
Conservation
,
C
),
add_item
(
conservation
,
C
).
add_item
(
conservation
,
[],
Conservation
,
Id
),
set_annotation
(
Id
,
conservation_list
,
C
).
delete_conservation
(
Conservation
)
:-
biocham_command
,
type
(
Conservation
,
solution
),
doc
(
'removes the given mass conservation law.'
),
solution_to_conservation
(
Conservation
,
C
),
find_item
([
model
:
current_model
,
id
:
Id
,
type
:
conservation
,
item
:
C
]),
find_item
(
[
model
:
current_model
,
id
:
Id
,
type
:
conservation
,
item
:
Conservation
]),
delete_item
(
Id
).
...
...
@@ -65,7 +66,10 @@ check_conservations :-
(see also \\command{add_conservation/1}).'
),
forall
(
item
([
model
:
current_model
,
kind
:
conservation
,
item
:
C
]),
(
item
([
model
:
current_model
,
kind
:
conservation
,
id
:
Id
]),
get_annotation
(
Id
,
conservation_list
,
C
)
),
check_conservation
(
C
)
).
...
...
conservation_laws.plt
View file @
50805643
...
...
@@ -9,10 +9,11 @@ test(
[
setup(models:clear_model),
cleanup(models:clear_model),
true(Conservations == [[1*'a-a', 2*'a']])
forall(member(Input, ['a-a' + 2*'a', 'b', 'a' + 'b'])),
true(Conservations == [Input])
]
) :-
command(add_conservation(
a-a + 2*a
)),
command(add_conservation(
Input
)),
all_items([model: current_model, kind: conservation], Conservations).
%%% FIXME should test that conservations are properly used for numerical
...
...
@@ -23,7 +24,7 @@ test(
[
setup(set_some_conservations),
cleanup(models:clear_model),
true(Conservations == [
[1*'a-a', 2*'a'], [1*'c-c', 2*'c']
])
true(Conservations == [
'a-a'+2*a,'c-c'+2*c
])
]
) :-
command(delete_conservation(b-b + 2*b)),
...
...
@@ -48,7 +49,7 @@ test(
setup(set_some_conservations),
cleanup(models:clear_model),
true(Conservations ==
'[0]
[1*a-a,2*a]\n[1] [1*b-b,2*b]\n[2] [1*c-c,2*c]
\n')
'[0]
a-a+2*a\n[1] b-b+2*b\n[2] c-c+2*c
\n')
]
) :-
with_output_to(atom(Conservations), command(list_conservations)).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment