119 lines
2.2 KiB
Text
119 lines
2.2 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Cours\n",
|
|
"\n",
|
|
"## V. David 18/10\n",
|
|
"\n",
|
|
"Correction robot atelier d'assemblage\n",
|
|
"\n",
|
|
"Proposition de la classe :"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"deposer():\n",
|
|
" P(RB)\n",
|
|
" Examiner()\n",
|
|
"\n",
|
|
" if(il_faut_tourner):\n",
|
|
" P(RA)\n",
|
|
" tourner()\n",
|
|
" V(RA)\n",
|
|
"\n",
|
|
" poser_la_piece()\n",
|
|
" V(RB)\n",
|
|
"\n",
|
|
"prendre():\n",
|
|
" P(RA)\n",
|
|
" Examiner()\n",
|
|
"\n",
|
|
" if(il_faut_tourner)\n",
|
|
" P(RB)\n",
|
|
" tourner()\n",
|
|
" V(RB)\n",
|
|
"\n",
|
|
" enlever_la_piece()\n",
|
|
" V(RA)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Correction de la proposition :\n",
|
|
"Vérifier que les actions fonctionnent, puis vérifier les deadlocks\n",
|
|
"Remède deadlock p23 : désymétriser les codes"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"P(S_libre)\n",
|
|
"deposer():\n",
|
|
" P(RB)\n",
|
|
" Examiner()\n",
|
|
"\n",
|
|
" if(il_faut_tourner):\n",
|
|
" V(RB)\n",
|
|
" P(RA)\n",
|
|
" P(RB)\n",
|
|
"\n",
|
|
" examiner()\n",
|
|
" if(il_faut_tourner):\n",
|
|
" tourner()\n",
|
|
"\n",
|
|
" V(RA)\n",
|
|
"\n",
|
|
" poser_la_piece()\n",
|
|
" V(RB)\n",
|
|
"V(S_occupe)\n",
|
|
"\n",
|
|
"\n",
|
|
"P(S_occupe)\n",
|
|
"prendre():\n",
|
|
" P(RA)\n",
|
|
" Examiner()\n",
|
|
"\n",
|
|
" if(il_faut_tourner)\n",
|
|
" P(RB)\n",
|
|
" tourner()\n",
|
|
" V(RB)\n",
|
|
"\n",
|
|
" enlever_la_piece()\n",
|
|
" V(RA)\n",
|
|
"V(S_libre)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3.8.10 64-bit",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"name": "python",
|
|
"version": "3.8.10"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|