Category: robotics and artificial intelligence

robotics and artificial intelligence program in java

Robotic arm program in java

Robotic arm program in java

import java.applet.*; import java.awt.*; /*<applet code="robot" height="400" width="500"></applet>*/ public class robot extends Applet implements Runnable{ Thread t=null; int state; //int i=250,j=350,k=250,l=250,n=150,o=350; int m=0; boolean stopFlag; int x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6; public void init() { x1=100; y1=450; x2=150;...

8 queen problem program in java

8 queen problem program in java

import java.io.*; class operation { int x[]=new int[20]; int count=0; public boolean place(int row,int column) { int i; for(i=1;i<=row-1;i++) { //checking for column and diagonal conflicts if(x[i] == column) return false; else if(Math.abs(x[i] -...

traveling salesman problem program in java

traveling salesman problem program in java

import java.util.*; import java.text.*; class TSP { int weight[][],n,tour[],finalCost; //n-no. of nodes final int INF=800; public TSP() { Scanner s=new Scanner(System.in); System.out.println("Enter no. of nodes:"); n=s.nextInt(); weight=new int[n][n]; tour=new int[n-1]; for(int i=0;i<n;i++) { for(int...

knight's tour problem java

knight's tour problem java

import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.net.URL; import java.util.ArrayList; public class KT extends Applet { public final static int DELAY = 500; private Thread thd; public void init () { Label lblTitle =...