SlideShare ist ein Scribd-Unternehmen logo
1 von 19
An Elementary Navigation Simulated in Java Presented by Jinho D. Choi
Artificial Intelligence   ,[object Object],[object Object],[object Object]
Solving a maze ,[object Object],[object Object],[object Object],[object Object],[object Object]
boolean solveMaze(var maze, var location) { if (reach the goal) return true; else { // moving to an empty cell if ((down-cell is empty) || (right-cell is empty) ||   (up-cell is empty)  || (left-cell is empty)) {   maze[location] = ‘X’; // mark the location   if (down-cell is empty) return solveMaze(maze, down-cell);   else if (right-cell is empty) return solveMaze(maze, right-cell);   else if (up-cell is empty) return solveMaze(maze, up-cell); else if (left-cell is empty) return solveMaze(maze, left-cell); } // backtracking else if ((down-cell is marked) || (right-cell is marked) || (up-cell is marked)  || (left-cell is marked)) {   maze[location] = ‘#’; // block the location     if (down-cell is marked) return solveMaze(maze, down-cell);   else if (right-cell is marked) return solveMaze(maze, right-cell);   else if (up-cell is marked) return solveMaze(maze, up-cell);   else if (left-cell is marked) return solveMaze(maze, left-cell);   else return false; // path does not exist } } }
Solving a maze with the fixed entry and exit ,[object Object],[object Object],.***... ..**.** *....** **.*.** .*.*.** ****... ******.
boolean solveMaze(int r, int c) { if (r == MAX-1 && c == MAX-1) return true; // reaches the exit else if (maze[r+1][c]=='.') || (maze[r-1][c]=='.') ||   (maze[r][c+1]=='.') || (maze[r][c-1]=='.')) { maze[r][c] = '+'; // moves to an empty cell if  (maze[r+1][c] == '.') r++; else if (maze[r][c+1] == '.') c++; else if (maze[r-1][c] == '.') r--; else if (maze[r][c-1] == '.') c--; } else { maze[r][c] = '-'; // backtracks if  (maze[r+1][c] == '+') r++; else if (maze[r][c+1] == '+') c++; else if (maze[r-1][c] == '+') r--; else if (maze[r][c-1] == '+') c--; else   return false; // no path exists } return solveMaze(r, c); } Examples 1.1
Solving a maze with the unfixed entry and exit ,[object Object],[object Object]
Finding the best path through a maze   ,[object Object],[object Object],[object Object],[object Object],Example 1.5
Driving on a street I (A single car)   ,[object Object],[object Object]
Speed limits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Visiting a place   ,[object Object],[object Object],[object Object],[object Object],[object Object],int iMap[][] = {{0, 0, 4, 1, 0, 0, 2, 0, 0},   {0, 1, 4, 1, 4, 2, 2, 1, 0},   {5, 5, 4, 5, 5, 5, 5, 5, 5},   {3, 3, 4, 3, 3, 3, 2, 3, 3},   {0, 5, 4, 0, 0, 0, 2, 1, 1},   {0, 3, 4, 0, 0, 0, 2, 5, 0},   {1, 1, 4, 0, 0, 0, 2, 3, 0},   {0, 0, 4, 2, 4, 1, 2, 0, 0},   {0, 0, 3, 3, 3, 3, 2, 1, 0}};
Stop signs ,[object Object],[object Object],[object Object],[object Object]
Traffic signals ,[object Object],[object Object],[object Object],[object Object]
Driving on a street II (Multiple cars)   ,[object Object],[object Object],[object Object]
Three moving objects   ,[object Object],[object Object],[object Object],[object Object]
Visiting a place against 3 other objects ,[object Object],[object Object],[object Object]
Day and night situations ,[object Object],[object Object],[object Object]
Appendix Blackjack Chess 4 / 4 Puzzle Elephant Spinout
Thanks for coming to my presentation http://www.public.coe.edu/organizations/ComputerClub/

Weitere ähnliche Inhalte

Andere mochten auch

Emotions- Photographer Cristina Garzone
Emotions- Photographer Cristina GarzoneEmotions- Photographer Cristina Garzone
Emotions- Photographer Cristina Garzone
maditabalnco
 
Body painting festival 2008 Mainz
Body painting festival 2008 MainzBody painting festival 2008 Mainz
Body painting festival 2008 Mainz
Lia Dumitrescu
 
Gaudi casa batllo present.esp3
Gaudi casa batllo present.esp3Gaudi casa batllo present.esp3
Gaudi casa batllo present.esp3
scenic97
 
Majestic And Solitary
Majestic And  SolitaryMajestic And  Solitary
Majestic And Solitary
Vili 48
 

Andere mochten auch (14)

Jingel Bells - Jim Reeves
Jingel Bells - Jim ReevesJingel Bells - Jim Reeves
Jingel Bells - Jim Reeves
 
Emotions- Photographer Cristina Garzone
Emotions- Photographer Cristina GarzoneEmotions- Photographer Cristina Garzone
Emotions- Photographer Cristina Garzone
 
Water drops
Water dropsWater drops
Water drops
 
2008 Monthly Calendar Celebrites Feminines
2008 Monthly Calendar Celebrites Feminines2008 Monthly Calendar Celebrites Feminines
2008 Monthly Calendar Celebrites Feminines
 
30 paintings by sorolla
30 paintings by sorolla30 paintings by sorolla
30 paintings by sorolla
 
Forget me not
Forget me notForget me not
Forget me not
 
Woman
WomanWoman
Woman
 
Issey miyake
Issey miyakeIssey miyake
Issey miyake
 
Body painting festival 2008 Mainz
Body painting festival 2008 MainzBody painting festival 2008 Mainz
Body painting festival 2008 Mainz
 
El Juguete artesanal mexicano (por: carlitosrangel)
El Juguete artesanal mexicano (por: carlitosrangel)El Juguete artesanal mexicano (por: carlitosrangel)
El Juguete artesanal mexicano (por: carlitosrangel)
 
Gaudi casa batllo present.esp3
Gaudi casa batllo present.esp3Gaudi casa batllo present.esp3
Gaudi casa batllo present.esp3
 
Majestic And Solitary
Majestic And  SolitaryMajestic And  Solitary
Majestic And Solitary
 
Human Alphabets 1
Human Alphabets 1Human Alphabets 1
Human Alphabets 1
 
Human Alphabets 3 (new)
Human Alphabets 3 (new)Human Alphabets 3 (new)
Human Alphabets 3 (new)
 

Ähnlich wie An elementary navigation simulated in Java

hello the code given is mostly complete but I need help with the Sol.pdf
hello the code given is mostly complete but I need help with the Sol.pdfhello the code given is mostly complete but I need help with the Sol.pdf
hello the code given is mostly complete but I need help with the Sol.pdf
almonardfans
 
Write a C++ program which generates and displays a random walk acros.pdf
Write a C++ program which generates and displays a random walk acros.pdfWrite a C++ program which generates and displays a random walk acros.pdf
Write a C++ program which generates and displays a random walk acros.pdf
mckenziecast21211
 

Ähnlich wie An elementary navigation simulated in Java (8)

Midterm Progress Report (Dynamic Sparse A-Star)
Midterm Progress Report (Dynamic Sparse A-Star)Midterm Progress Report (Dynamic Sparse A-Star)
Midterm Progress Report (Dynamic Sparse A-Star)
 
Maze Solver Robot using Arduino
Maze Solver Robot using ArduinoMaze Solver Robot using Arduino
Maze Solver Robot using Arduino
 
hello the code given is mostly complete but I need help with the Sol.pdf
hello the code given is mostly complete but I need help with the Sol.pdfhello the code given is mostly complete but I need help with the Sol.pdf
hello the code given is mostly complete but I need help with the Sol.pdf
 
10 Recursion
10 Recursion10 Recursion
10 Recursion
 
Classical programming interview questions
Classical programming interview questionsClassical programming interview questions
Classical programming interview questions
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
Write a C++ program which generates and displays a random walk acros.pdf
Write a C++ program which generates and displays a random walk acros.pdfWrite a C++ program which generates and displays a random walk acros.pdf
Write a C++ program which generates and displays a random walk acros.pdf
 
5.5 back track
5.5 back track5.5 back track
5.5 back track
 

Mehr von Jinho Choi

Mehr von Jinho Choi (20)

Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
 
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
 
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
 
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
 
The Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference ResolutionThe Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference Resolution
 
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
 
Abstract Meaning Representation
Abstract Meaning RepresentationAbstract Meaning Representation
Abstract Meaning Representation
 
Semantic Role Labeling
Semantic Role LabelingSemantic Role Labeling
Semantic Role Labeling
 
CKY Parsing
CKY ParsingCKY Parsing
CKY Parsing
 
CS329 - WordNet Similarities
CS329 - WordNet SimilaritiesCS329 - WordNet Similarities
CS329 - WordNet Similarities
 
CS329 - Lexical Relations
CS329 - Lexical RelationsCS329 - Lexical Relations
CS329 - Lexical Relations
 
Automatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue ManagementAutomatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue Management
 
Attention is All You Need for AMR Parsing
Attention is All You Need for AMR ParsingAttention is All You Need for AMR Parsing
Attention is All You Need for AMR Parsing
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to Dialogue
 
Real-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue UnderstandingReal-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue Understanding
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Tries - Put
Tries - PutTries - Put
Tries - Put
 
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's DiseaseMulti-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
 
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue ContextsBuilding Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
 
How to make Emora talk about Sports Intelligently
How to make Emora talk about Sports IntelligentlyHow to make Emora talk about Sports Intelligently
How to make Emora talk about Sports Intelligently
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

An elementary navigation simulated in Java

  • 1. An Elementary Navigation Simulated in Java Presented by Jinho D. Choi
  • 2.
  • 3.
  • 4. boolean solveMaze(var maze, var location) { if (reach the goal) return true; else { // moving to an empty cell if ((down-cell is empty) || (right-cell is empty) || (up-cell is empty) || (left-cell is empty)) { maze[location] = ‘X’; // mark the location   if (down-cell is empty) return solveMaze(maze, down-cell); else if (right-cell is empty) return solveMaze(maze, right-cell); else if (up-cell is empty) return solveMaze(maze, up-cell); else if (left-cell is empty) return solveMaze(maze, left-cell); } // backtracking else if ((down-cell is marked) || (right-cell is marked) || (up-cell is marked) || (left-cell is marked)) { maze[location] = ‘#’; // block the location   if (down-cell is marked) return solveMaze(maze, down-cell); else if (right-cell is marked) return solveMaze(maze, right-cell); else if (up-cell is marked) return solveMaze(maze, up-cell); else if (left-cell is marked) return solveMaze(maze, left-cell); else return false; // path does not exist } } }
  • 5.
  • 6. boolean solveMaze(int r, int c) { if (r == MAX-1 && c == MAX-1) return true; // reaches the exit else if (maze[r+1][c]=='.') || (maze[r-1][c]=='.') || (maze[r][c+1]=='.') || (maze[r][c-1]=='.')) { maze[r][c] = '+'; // moves to an empty cell if (maze[r+1][c] == '.') r++; else if (maze[r][c+1] == '.') c++; else if (maze[r-1][c] == '.') r--; else if (maze[r][c-1] == '.') c--; } else { maze[r][c] = '-'; // backtracks if (maze[r+1][c] == '+') r++; else if (maze[r][c+1] == '+') c++; else if (maze[r-1][c] == '+') r--; else if (maze[r][c-1] == '+') c--; else return false; // no path exists } return solveMaze(r, c); } Examples 1.1
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Appendix Blackjack Chess 4 / 4 Puzzle Elephant Spinout
  • 19. Thanks for coming to my presentation http://www.public.coe.edu/organizations/ComputerClub/