Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProB 2 Jupyter Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB 2 Jupyter Kernel
Commits
92da8d9e
Commit
92da8d9e
authored
6 years ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Show error when using :show in an uninitialised state
parent
3251d787
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
notebooks/tests/show.ipynb
+12
-40
12 additions, 40 deletions
notebooks/tests/show.ipynb
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+4
-0
4 additions, 0 deletions
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
with
16 additions
and
40 deletions
notebooks/tests/show.ipynb
+
12
−
40
View file @
92da8d9e
...
...
@@ -55,26 +55,12 @@
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<table><tbody>\n",
"<tr>\n",
"<td style=\"padding:0\"></td>\n",
"<td style=\"padding:0\"></td>\n",
"</tr>\n",
"<tr>\n",
"<td style=\"padding:0\"></td>\n",
"<td style=\"padding:0\"></td>\n",
"</tr>\n",
"</tbody></table>"
],
"text/plain": [
"<Animation function visualisation>"
"ename": "CommandExecutionException",
"evalue": ":show: Machine is not initialised, cannot show animation function visualisation",
"output_type": "error",
"traceback": [
"\u001b[1m\u001b[31m:show: Machine is not initialised, cannot show animation function visualisation\u001b[0m"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
...
...
@@ -107,26 +93,12 @@
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"<table><tbody>\n",
"<tr>\n",
"<td style=\"padding:0\"></td>\n",
"<td style=\"padding:0\"></td>\n",
"</tr>\n",
"<tr>\n",
"<td style=\"padding:0\"></td>\n",
"<td style=\"padding:0\"></td>\n",
"</tr>\n",
"</tbody></table>"
],
"text/plain": [
"<Animation function visualisation>"
"ename": "CommandExecutionException",
"evalue": ":show: Machine is not initialised, cannot show animation function visualisation",
"output_type": "error",
"traceback": [
"\u001b[1m\u001b[31m:show: Machine is not initialised, cannot show animation function visualisation\u001b[0m"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
...
...
%% Cell type:code id: tags:
```
prob
:help :show
```
%% Output
```
:show
```
Show the machine's animation function visualisation for the current state.
:show
Show the machine's animation function visualisation for the current state.
%% Cell type:code id: tags:
```
prob
:load Hanoi.mch
```
%% Output
Loaded machine: Hanoi : []
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table><tbody>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
</tbody></table>
<Animation function visualisation>
:show: Machine is not initialised, cannot show animation function visualisation
%% Cell type:code id: tags:
```
prob
:constants
```
%% Output
Machine constants set up using operation 0: $setup_constants()
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table><tbody>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
</tbody></table>
<Animation function visualisation>
:show: Machine is not initialised, cannot show animation function visualisation
%% Cell type:code id: tags:
```
prob
:init
```
%% Output
Machine initialised using operation 1: $initialise_machine()
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table><tbody>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:exec Move
```
%% Output
Executed operation 2: Move(orig,dest,1)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table><tbody>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
</tbody></table>
<Animation function visualisation>
%% Cell type:code id: tags:
```
prob
:exec Move
```
%% Output
Executed operation 4: Move(orig,Stakes3,2)
%% Cell type:code id: tags:
```
prob
:show
```
%% Output
<table><tbody>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
<tr>
<td style="padding:0"></td>
<td style="padding:0"></td>
<td style="padding:0"></td>
</tr>
</tbody></table>
<Animation function visualisation>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/prob2/jupyter/commands/ShowCommand.java
+
4
−
0
View file @
92da8d9e
...
...
@@ -44,6 +44,10 @@ public final class ShowCommand implements Command {
final
Trace
trace
=
this
.
animationSelector
.
getCurrentTrace
();
if
(!
trace
.
getCurrentState
().
isInitialised
())
{
throw
new
UserErrorException
(
"Machine is not initialised, cannot show animation function visualisation"
);
}
final
GetImagesForMachineCommand
cmd1
=
new
GetImagesForMachineCommand
();
trace
.
getStateSpace
().
execute
(
cmd1
);
final
Map
<
Integer
,
String
>
images
=
cmd1
.
getImages
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment