OT 란?


OTOperational Technology의 줄임말입니다.

한국말로는 운영 기술이라는 뜻입니다.

 

물리적인 장비인 가스 밸브, 온도계, 펌프, 모터를 모니터링하고 제어하는 시스템을 의미합니다.

자동차 공장, 화학 공장, 제약 공장 등에서 실제 사용 중인 물리적 장비의 상태에 대해서 확인한다던지 컨트롤하기 위한 시스템을 의미합니다.

 

다른 말로는 ICS(Industrial Control System)라고도 불립니다.

SCADA, DCS, SIS 시스템과 같은 산업적인 제품 생산에 사용되는 제어 시스템을 통칭하는 용어입니다.

 

스카다(SCADA)와 디씨에스(DCS) 정의 및 차이점

SCADA 란 무엇인가? SCADA는 Supervisory Control and Data Acquisition의 줄임말이고, 한국말로는 감독 제어 및 데이터 수집입니다. ICS(산업 생산 시설, 기반 시설, 설비 시설 등)를 감시 제어하고 데이터를 취..

itot.tistory.com

 

실무에서는 OT와 ICS라는 동일시 여기는 분들도 계시고 다르다는 분들도 계십니다.

하지만, 이 단어에 대해서 정의를 내린 유명한 IT분야 리서치 회사가 있습니다.

 

가트너(Gartner) 그룹입니다.

이 가트너 그룹에서 ICS와 OT의 정의를 내렸습니다.

OT 안에 ICS가 포함되고 그 ICS 안에 SCADA와 DCS가 포함된다라고 말입니다.

 

OT 및 ICS 정의

 

 기능은 크게 2가지로 볼 수 있습니다.

1. 관리자가 시스템의 상태 확인 및 조작할 수 있는 조작 및 모니터링 기능

2. 관리자가 시스템을 제어할 수 있는 제어 기능

 

조작 및 모니터링 기능은 물리적인 장비의 현재 상태를 확인할 수 있으며, 물리적인 장비들의 프로세스의 설정 값(기본, 한계 값 등)을 조작할 수 있는 기능입니다.

제어 기능은 물리적인 장비들을 실질적으로 ON/OFF와 같이 시스템을 직접 제어하는 기능을 의미합니다.

'OT > Overview' 카테고리의 다른 글

스카다(SCADA)와 디씨에스(DCS) 정의 및 차이점  (0) 2021.01.26

숫자 빙고 게임

 


 

public static void map(int n, int m, int pick[], int user[][]) {
	int w = 0;
	boolean ch = false;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			while (true) {
				int tmp = (int) (Math.random() * m) + 1;
				for (int k = 0; k < pick.length; k++) {
					if (tmp == pick[k])
						ch = true;
				}
				if (ch) {
					ch = false;
					continue;
				} else {
					pick[w++] = user[i][j] = tmp;
					break;
				}
			}
		}
	}
}

public static void line(int n, int user[][]) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			System.out.print(user[i][j] + "\t");
		}
		System.out.println();
	}
	System.out.println();

}

public static void ucheck(int user[][], int com[][], int uch) {
	for (int i = 0; i < user.length; i++) {
		for (int j = 0; j < user.length; j++) {
			if (user[i][j] == uch) {
				user[i][j] = 0;
			}
			if (com[i][j] == uch) {
				com[i][j] = 0;
			}
		}
	}
}

public static void ccheck(int m, int com[][], int user[][]) {
	int tmp = 0;
	int cnt = 0, c=0;
	int sa=0;
	

	while (cnt<1) {
		tmp = (int) (Math.random() * m + 1);
		for (int i = 0; i < com.length; i++) {
			for (int j = 0; j < com.length; j++) {
				if (com[i][j] == tmp) {
					com[i][j] = 0;
					sa=tmp;
				}
			}
		}
		
		for (int i = 0; i < user.length; i++) {
			for (int j = 0; j < user.length; j++) {
				if (user[i][j] == sa) {
					user[i][j] = 0;
				}
			}
		}
		cnt+=1;
	}
	System.out.println("컴퓨터 차례 - 고른 숫자는 : "+tmp);
}

public static void bingo(int n,int b,int user[][], int com[][]) {
	int bingo=0, cbingo=0;
	int cnt=0, cntt=0, ccnt=0, ccntt=0;
	
	for(int i=0; i<n; i++) {
		cnt=0; cntt=0; ccnt=0; ccntt=0;
		for(int j=0; j<n; j++) {
			if(user[i][n-1-j]==0) {
				cnt+=1;
				if(cnt==n) {
					bingo+=1;
					cnt=0;
				}
			}
			if(user[n-1-j][i]==0) {
				cntt+=1;
				if(cntt==n) {
					bingo+=1;
					cntt=0;
				}
			}
			
			if(com[i][n-1-j]==0) {
				ccnt+=1;
				if(ccnt==n) {
					cbingo+=1;
					ccnt=0;
				}
			}
			if(com[n-1-j][i]==0) {
				ccntt+=1;
				if(ccntt==n) {
					cbingo+=1;
					ccntt=0;
				}
			}
		}	
	}
	
	if(bingo>=b) {
		System.out.println(bingo+"줄로 유저 승!!");
		System.exit(0);
	}
	else if(cbingo>=b) {
		System.out.println(cbingo+"줄로 컴퓨터 승!!");
		System.exit(0);
	}
	
	else if(bingo>=1 | cbingo>=1) {
		System.out.println("유저 : "+  bingo +" 줄 빙고\n" + "컴퓨터 : " + cbingo + " 줄 빙고");
	}
	
}

public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int uch = 0;
	
	
	System.out.print("n * n 배열만큼 뽑을 n을 입력 : ");
	int n = Integer.parseInt(br.readLine());
	System.out.print("빙고값 : 1 ~ m 숫자 m을 입력(m = n*n이상) : ");
	int m = Integer.parseInt(br.readLine());
	System.out.print("빙고 몇줄시 승리 할지 입력(n*2까지 가능) : ");
	int b = Integer.parseInt(br.readLine());

	int user[][] = new int[n][n];
	int com[][] = new int[n][n];
	int upick[] = new int[n * n];
	int cpick[] = new int[n * n];

	map(n, m, upick, user);
	map(n, m, cpick, com);
	System.out.println("[사용자 빙고 판]");
	line(n, user);
	System.out.println("[컴퓨터 빙고 판]");
	line(n, com);

	for(;;) {
	System.out.print("유저차례 - 고를 숫자 입력 :");
	uch = Integer.parseInt(br.readLine());
	ucheck(user, com, uch);
	System.out.println("[사용자 빙고 판]");
	line(n, user);
	System.out.println("[컴퓨터 빙고 판]");
	line(n, com);

	ccheck(m, com, user);
	System.out.println("[사용자 빙고 판]");
	line(n, user);
	System.out.println("[컴퓨터 빙고 판]");
	line(n, com);
	
	bingo(n,b,user,com);
	}
}

 

출력하면 다음과 같습니다.

 

가위바위보 첫 번째

 


 

int ch=0;
int com=0;

while(true) {
	System.out.print("1.가위 2.바위 3.보 4.종료 > ");
	ch = System.in.read()-'0';
	System.in.skip(2);
	
	if(ch < 1 | ch > 4) {
		System.out.println("없는 번호입니다. 다시 고르세요.");
		continue;
	}
	else if(ch == 4) {
		System.out.println("종료합니다.");
		break;
	}
	else {
		com = (int) (Math.random() *3 + 1);
		System.out.println("유저는 " + ((ch == 1)? "가위" : (ch == 2)? "바위" : "보") + "를 내었습니다.");
		System.out.println("컴퓨터는 " + ((com == 1)? "가위" : (com == 2)? "바위" : "보") + "를 내었습니다.");
	}			
	System.out.println();
	
	switch(ch * com) {
		case 2 :
			System.out.println(((ch > com)? "유저" : "컴퓨터") + "가 이겼습니다.");
			break;
		case 3 :
			System.out.println(((ch > com)? "컴퓨터" : "유저") + "가 이겼습니다.");
			break;
		case 6:
			System.out.println(((ch > com)? "유저" : "컴퓨터") + "가 이겼습니다.");
			break;
		default :
			System.out.println("비겼습니다.");
	}
}

 

출력하면 다음과 같습니다.

 

가위바위보 이미지

 


 

가위바위보 두 번째

 


 

int sel = 0;
System.out.println("가위 바위 보");

for (;;) {

	do {
		System.out.println("1.가위 2.바위 3.보 4.종료");
		System.out.print("메뉴> ");

		sel = System.in.read() - 48;
		
		System.in.skip(2);
	} while (sel > 4 || sel < 1);

	if (sel == 4) {
		System.out.println("게임을 종료합니다.");
		break;
	}

	if(sel >= 1 && sel <=4) {
		int com = (int) (Math.random() * 3 + 1);

		System.out.println("사용자 : " + ((sel==1)? "가위" : (sel==2)? "바위" : "보"));
		System.out.println("컴퓨터 : " + ((com==1)? "가위" : (com==2)? "바위" : "보"));
		
		if (sel == 1) {
			if (com == 1) {
				System.out.println("무승부");
			} else if (com == 2) {
				System.out.println("컴퓨터 승");
			} else {
				System.out.println("사용자 승");
			}
		} else if (sel == 2) {
			if (com == 1) {
				System.out.println("사용자 승");
			} else if (com == 2) {
				System.out.println("무승부");
			} else {
				System.out.println("컴퓨터 승");
			}
		} else if (sel == 3) {
			if (com == 1) {
				System.out.println("컴퓨터 승");
			} else if (com == 2) {
				System.out.println("사용자 승");
			} else {
				System.out.println("무승부");
			}
		}
	}
}

 

출력하면 다음과 같습니다.

 

가위바위보 이미지2

 


 

가위바위보 세 번째

 


 

System.out.println("==가위 바위 보 게임==");
System.out.println("1.가위 2.바위 3.보 4.게임종료");

int user = 0;
int com = 0;

String ga = "가위";
String ba = "바위";
String bo = "보";

do {
	System.out.print("입력>");
	user = System.in.read() - 48;
	System.in.skip(2);
	com = (int) (Math.random() * 3 + 1);
	
	if(user==4) {
		System.out.println("게임을 종료합니다");
		System.exit(0);
	}

	if(user >= 1 && user <=4) {
		if (user == 1) {
			System.out.println("사용자: " + ga);
		} else if (user == 2) {
			System.out.println("사용자: " + ba);
		} else {
			System.out.println("사용자: " + bo);
		}

		if (com == 1) {
			System.out.println("컴퓨터: " + ga);
		} else if (com == 2) {
			System.out.println("컴퓨터: " + ba);
		} else {
			System.out.println("컴퓨터: " + bo);
		}
	

		switch (user - com) {
		case -2:
			System.out.println("사용자 승리!!" + "\n");
			break;
		case -1:
			System.out.println("컴퓨터 승리!!" + "\n");
			break;
		case 0:
			System.out.println("비겼습니다!!" + "\n");
			break;
		case 1:
			System.out.println("사용자 승리!!" + "\n");
			break;
		case 2:
			System.out.println("컴퓨터 승리!!" + "\n");
			break;
		default:
			System.out.println("다시 입력하세요!!" + "\n");
		}
	}

} while (user != 4);

 

출력하면 다음과 같습니다.

 

가위바위보 이미지3

+ Recent posts