示例#1
0
def _testfault():
	import cyberAttack
	cosimProps = {'port':'6267', 'hostname':'localhost', 'glmPath':omf.omfDir + '/scratch/CIGAR/test_Exercise_4_2_1.glm', 'startTime':'2000-01-01 05:00:00','endTime':'2000-01-01 05:30:00', 'stepSizeSeconds':60}
	agents = []
	agents.append(cyberAttack.ReadIntervalAttackAgent('FaultChecker', '2000-01-01 05:02:00', '2000-01-01 05:12:00', 'node711-741', 'conductor_resistance'))
	coord = Coordinator(agents, cosimProps)
	print coord.drawPrettyResults()
示例#2
0
def _test5():
	# test with AlertAgent, ReadAttackAgent, ReadIntervalAttackAgent, and WriteAttackAgent
	# shows how WriteAttackAgent and WriteIntervalAttackAgent interact with ReadAttackAgent and ReadIntervalAttackAgent
	import cyberAttack
	cosimProps = {'port':'6267', 'hostname':'localhost', 'glmPath':omf.omfDir + '/scratch/CIGAR/test_smsSingle.glm', 'startTime':'2000-01-01 00:00:00','endTime':'2000-01-05 00:00:00', 'stepSizeSeconds':3600}
	agents = []
	agents.append(cyberAttack.AlertAgent('Joe', '2000-01-03 04:00:00'))
	agents.append(cyberAttack.ReadAttackAgent('Sue', '2000-01-02 10:00:00', 'tm_1', 'measured_power'))
	agents.append(cyberAttack.ReadIntervalAttackAgent('David', '2000-01-02 08:00:00', '2000-01-03 08:00:00', 'tm_1', 'measured_real_energy'))
	agents.append(cyberAttack.WriteAttackAgent('Shammya', '2000-01-02 16:00:00', 'tm_1', 'measured_real_energy', '0.0'))
	agents.append(cyberAttack.WriteIntervalAttackAgent('Dan', '2000-01-03 20:00:00', '2000-01-04 08:00:00', 'inverter_1', 'power_factor', '0.4'))
	agents.append(cyberAttack.ReadIntervalAttackAgent('Dan2.0', '2000-01-03 12:00:00', '2000-01-04 12:00:00', 'tm_2', 'measured_reactive_power'))
	agents.append(cyberAttack.DefendByValueAgent('Dan.biz', 'battery_1', 'generator_status', 'ONLINE'))
	agents.append(cyberAttack.WriteAttackAgent('Alice', '2000-01-01 04:00:00', 'battery_1', 'generator_status', 'OFFLINE'))
	print 'Starting co-sim with 8 agents.'
	coord = Coordinator(agents, cosimProps)
	# print coord.drawResults()
	print coord.drawPrettyResults()
示例#3
0
def _test4():
	# test with AlertAgent, ReadAttackAgent, and ReadAttackIntervalAgent
	import cyberAttack
	cosimProps = {'port':'6267', 'hostname':'localhost', 'glmPath':omf.omfDir + '/scratch/CIGAR/test_smsSingle.glm', 'startTime':'2000-01-01 00:00:00','endTime':'2000-01-05 00:00:00', 'stepSizeSeconds':3600}
	agents = [
		cyberAttack.AlertAgent('2000-01-03 04:00:00'),
		cyberAttack.ReadAttackAgent('2000-01-02 10:00:00', 'tm_1', 'measured_power'),
		cyberAttack.ReadIntervalAttackAgent('2000-01-02 08:00:00', '2000-01-03 08:00:00', 'tm_1', 'measured_real_energy')
	]
	print 'Starting co-sim with 3 agents.'
	coord = Coordinator(agents, cosimProps)
	print coord.drawResults()