Home

A Multi-Agent Approach for Distribution System Restoration

image

Contents

1. FAIA FA1B FA1B BA1 BA5 SAC BAY L L L S2 S6 S10 BA2 BA6 BA10 L L L S3 S7 S11 SBC BA3 BA7 BA11 12 BA12 T1 T9 BA21 S21 BA22 S23 BA23 S24 BA16 BA20 BA24 L L L S16 S20 S25 FA2A Fa2Bp BI sac FA2C Load Switch connected closed Load Switch disconnected open Source2 Figure A 6 Fault scenario 2 FAIC has obtained full power from FA2C and FA2B and connected all its loads 70 Loss of Sourcei Source1 FA1A FA1B FA1C BA1 BA5 SAC BA9 S10 BA10 S11 BA11 S12 BA12 L L SBC L L T1 T2 T3 T4 T5 T6 T7 T9
2. BA17 BA21 i L S17 S21 BA18 BA22 L L S18 S23 BAig SBC BA23 L L S19 S24 BA16 BA20 BA24 L L L S16 S20 S25 FA2A FA2B MJ sac FA2C Load Switch connected closed Source2 Load ES Switch disconnected open Figure A 2 Fault Scenario 1 FeederAgent1A prepared for restoration 66 Source FA1A 1 FA1B S5 FA1C 6 BA9 S10 BA10 S11 BA11 S12 BA12 T1 T2 T9 BA21 S21 BA22 S23 BA23 S24 BA24 FA2A S16 S20 sac FA2C S25 Load Switch connected closed Source2 Load RI Switch disconnected open Figure A 3 Fault scenario 1 Feeder 1A fully restored by 1B and 1C 67 Q a Source1 dV cleared FA1A e FA1B amp 5 FA1C 6 BA9 10 BA10 11 BA11 12 BA12
3. BAY S10 BA10 11 BA11 12 BA12 T1 T9 BA21 S21 BA22 23 BA23 24 BA24 Line fault FA2A S16 S20 nc FA2C 9 Load Switch connected closed Load m Switch disconnected open Source2 Figure A 9 Fault Scenario 2 Line fault at feeder 2C while loss of source 1 73 Source BA9 S10 BA10 S11 BA11 S12 BA12 T1 s BA21 BA22 S23 BA23 S24 BA24 FA2A S16 FA2B S20 aie FA2C S25 Load Switch connected closed Load E Switch disconnected open Source2
4. ISLOCALNAME ISLOCALNAME ISLOCALNAME ISLOCALNAME ISLOCALNAME Se Ne NS NA ISLOCALNAME IGH rOglsterlransruron olAIE ly STATE 1 1 7 fsm registerrransrtaion SoTATE l STATE 2 2 7 Ism registerfransrLtroni STATEb 2 OTAIE o S97 fsm registerTransition fsm registerTransition fsm registerTransition fsm registerTransition STATE 3 STATE 3 3 STATE 3 STATE 4 ub STATE 3 STATE 1 1 STATE 3 STATE 5 5 fsm registerTransition STATE 4 STATE 4 4 rem registerlransr tion STATE 4 STATE G 9 IoNm registerTransition STrATE 4 SITATE dl 1 j ION rOeglsterlransrzcaoni orATIB 3p SIATE G 5 romregisterfranesxcion S LATE Or SLATE O amp 7 Iomregisbterfranertaon srATE Gy SITATE l 1 addBehaviour fsm DFAgentDescription dfd new DFAgentDescription dfd setName getAID ServiceDescription sd new ServiceDescription sd setType PowerGeneration sd setName FeederAgentlB dfd addServices sd try DFService register this dfd j catch FIPAException fe fe printStackTrace j Behaviour to handle subscription cancellations addBehaviour new CyclicBehaviour this public void action MessageTemplate subcancel MessageTemplate and Messagelempleve MatcehPEOCOCOLl EFIPANamesS InteraoctronProtocol RELPA SUBSCRIBE MessageTemplate MatchPerformative ACLMessage CANCEL ACLMessage cancelmsg myAgent receive subcancel if canc
5. Figure A 10 Fault Scenario 2 FA2C canceling subscription with FA1C 74 Source1 FAIA FA1B FA1B S1 S5 S9 BA9 S10 BA10 S11 BA11 S12 BA12 T1 is BA21 BA22 S23 BA23 BA16 BA20 BA24 FA2A W 516 Fa2B MS sac FA2C Load Switch connected closed Source2 Load m Switch disconnected open Figure A 11 Fault Scenario 2 FAIC unable to restore full power and prioritizes its loads 75 B MATLAB SIMULINK MODELS In this appendix the work carried out during the project concerning the connection of Matlab and JADE will be described In order to pass data from a Simulink model to an external program an embedded Mat lab function is used Embedded Matlab functions can be connected to any other block in a Simulink model They can include normal Matlab code as in regular Matlab function scripts although with some restrictions In this project they were used to take data from a model in Simulink an
6. myAgent send command Send reply ACLMessage inform cancelmsg createReply inform setPerformative ACLMessage INFORM myAgent send inform else block 134 Add behaviour to get confirmation that a FeederAgent has canceled a subscription addBehaviour new CyclicBehaviour this public void action MessageTemplate confirm MessageTemplate and Message template MatvehnConversaltionid contimm Cancel MessageTemplate MatchPerformative ACLMessage INFORM ACLMessage informmsg myAgent receive confirm if informmsg null Update power level float pwr contract extractContent informmsg 1 current powerlevel Current powerlovel pwr Contract System out println myAgent getLocalName Current powerlevel after CANCEL rcurrent power level j else block j Ly Adding SubscribtionResponder behaviour System out println Agent getLocalName waiting for Subscription MessageTemplate subtemplate MessageTemplate and MessageTemplate and MessageT mplate MatcohProtocol PiPANames I teractionProtocol FIPA SUBSCRIBE MessageTemplate MatchPerformative ACLMessage SUBSCRIBE MessageTemplate or MessagelTemplate MatohProtocol PIPANames InteractionPrOtocol FIPA SUBSCRIBE MessageTemplate MatchPerformative ACLMessage CANCEL MessageTemplate subtp MessageTemplate MatchProtocol FIPANames lInteractronProtocol PIPA SUBSCRIBE final Subscrip
7. Switch onLineSection Fault LineSection NeedPower Load i AgentActions SwitchIn Switch SwitchOut Switch Figure 6 5 Elements of the BusFeederOntology The predicates isConnected and isDisconnected are used by the BusAgent to inform the FeederAgent when a certain switch has been connected or disconnected while the predicate NeedPower 1s used to report the pre fault power consumption at a particular load for instance NeedPower Load loadnumber 4 voltagelevel 0 prefaultpower 40 This predicate informs the FeederAgent that 40 MW has to be restored to Load 4 The ontology consists of two agent actions SwitchIn and SwitchOut used by the FA to request a particular BA to connect or disconnect a certain switch e g SwitchIn Switch switchnumber 4 34 MAS Design 6 4 Protocols As mentioned above when a fault occurs on a feeder the FeederAgent will initiate a negotiation with one or more feeders to restore the power to its buses FIPA has stan dardized the way agents interact in several protocols Among those the FIPA Contract Net Interaction Protocol and the FIPA Subscribe Pro tocol have shown to be to suitable for the MAS developed in this project The sequence diagram of the FIPA Contract Net Interaction Protocol 1s shown in Figure 5 2 This protocol describes the case of one agent the initiator who wishes to have a task performed by one or more other
8. T9 T1 T2 BA21 S21 BA22 23 BA23 24 BA16 BA20 BA24 FA2A S16 en 20 sac FA2C S25 Load Switch connected closed Source2 Load Em Switch disconnected open Figure A 4 Fault Scenario 1 Clearance of fault and subsequently connection of switch S1 68 Fault Scenario 2 Loss of Source1 Source1 FA1A S9 BA9 S10 BA10 S11 BA11 S12 BA12 T9 T1 T2 BA21 S21 BA22 S23 BA23 S24 BA16 BA20 BA24 FA2A S16 raog Wi s20 sac FA2C S25 Load Switch connected closed Source2 Load E Switch disconnected open Figure A 5 Fault Scenario 2 The loss of Sourcel 69 Loss of Sauce Source
9. eer lt lt BA17 BA21 L L S17 S21 BA18 BA22 L L S18 S23 BA1g SBC BA23 L L S19 S24 BA16 BA20 BA24 L L L S16 S20 S25 FA2A Fa2B MI sac FA2C Load Switch connected closed Source2 Load uj Switch disconnected open Figure A 7 Fault scenario 2 FAIA has obtained full power from FA2A and con nected all its loads FAIC has requested its BAs to switch in their sectionalizing switches 71 Loss of Source1 Source1 BA9 S10 BA10 S11 BA11 S12 BA12 BA21 S21 BA22 23 BA23 S24 BA16 BA20 BA24 FA2A a raop M S sac FA2C MM 525 Load Switch connected closed Sou rce2 Load ml Switch disconnected open Figure A 8 Fault Scenario 2 FAIB accepting proposal from FA2B and FA2C Feeder 1A 1B and 1C fully restored 72 Source
10. exitValue 3 going to next state public int onEnd return exitValue j j private class State3 extends OneShotBehaviour private int exitValue public void action Waiting for RequestBehavior to finish System out printin Executing behaviour tgetBehaviourName if negotiation done true no proposals if step 4 if power transfer gt 0 something has been agreed if power transfer lt current request has not got full amount go to prioritazation exitValue 4 else exitValue 5 full amount achieved else exitValue 1 failed return to state 1 else exitValue 3 Repeat state public int onEnd return exitValue private class State4 extends OneShotBehaviour private int exitValue public void action Prioritize loads Priorities 2213 a Get power obtained Send shed command to lowest prioritized float sum 0 int i O while sumtprefaults i lt power transfer increment sum sum prefaults i oystem out printini sumr sum s ACLMessage connectload new ACLMessage ACLMessage REQUEST connectload addReceiver BAIDs i connectload settontent oconhecLt Load connectload setConversationid load command myAgent send connectload itt j oystem out printin i before while shed 1 while i lt 4 ACLMessage shedload new ACLMessage ACLMessage
11. Figure A 7 Fault scenario 2 FAIA has obtained full power from FA2A and con nected all its loads FAIC has requested its BAs to switch in their sectionalizing switches Figure A 9 Fault Scenario 2 Line fault at feeder 2C while loss of source 1 Figure A 10 Fault Scenario 2 FA2C canceling subscription with FAIC Figure A 11 Fault Scenario 2 FAIC unable to restore full power and prioritizes its loads Figure B 1 Data transfer between Matlab and JADE Figure B 2 Illustration of simple network to test data passing between Matlab and JADE Figure B 3 Simulink model of network with two sources and one load Figure B 4 Plot of active and reactive power for SourceB and SourceC and voltage at the load Figure B 5 Diagram of 6 bus network Figure B 6 Simulink model of 6 Bus network Figure C 1 handleCancel method of SubscriptionResponder Behaviour Figure C 2 SubscriptionInitiator Behaviour Figure C 3 Flowchart for BusAgent Cyclic Behavior Figure D 1 FIPA communicative acts LIST OF TABLES Table 3 1 FIPA Communicative Acts categorized after their usage Table 5 1 Distance values between the feeders Table 7 1 Prioritization of buses at a feeder Table 7 2 Pre fault load consumption values at each bus for fault scenario 1 Table 7 3 Pre fault load consumption values at each bus for fault scenario 2 List of Abbreviations LIST OF ABBREVIATIONS MAS Multi Agent System JADE Java Agent DEvelop
12. KOML was the first agent communication language to be developed in the 1990s Cur rently the most used agent communication language is the FIPA ACL FIPA the Foun dation for Intelligent Physical Agents consists of a collection of academic and indus trial organizations It was established in 1996 to develop a set of standards concerning software agent technology These standards were intended to make agent technology usable on a broad range of applications and thereby form the basis for the commercial deployment of agent technology 1 Agent communication languages like FIPA ACL are based on speech act theory Speech act theory provides a way to separate the content of a message from the intention of the message This 1s achieved by giving each message a specific performative or act be sides the actual content delivered with the message This performative denotes what the sender of the message want the receiver to do with the contents An act of a message could for instance be inform propose refuse agree or not understood Below 1s an ex ample of a FIPA ACL message with a request performative Here the intention of the sender of the message is to request the receiver to book a hotel in the period specified in the content field 18 The Agent Paradigm request sender agent identifier name alice mydomain com receiver agent identifier name bob yourdomain com ontology travel assistant language FIPA SL protocol fipa
13. failed Figure 6 8 Sequence diagram for FIPA Cancel Meta Protocol 6 5 FeederAgent design Each agent is composed of a number of behaviors A behavior represents a certain task to perform For the FeederAgent class the tasks are divided on the following behaviors e ContractNetInitiator Behavior This behavior initiates a power negotiation ac cording to the Contract Net Interaction Protocol e ContractNetResponder Behavior This behavior process any messages received which is part of the Contract Net Interaction Protocol e SubscriptionInitiator Behavior This behavior initiates a subscription with another FeederAgent according to the FIPA Subscribe Protocol e SubscriptionResponder Behavior This behavior process any message received with 1s part of a Subscription Protocol interaction e Fininite State Machine FSM Behavior This behavior is controlling the state of the FeederAgent During a reconfiguration the agent goes through different states so this behavior can be considered the main behavior 5 6 1 The use of the DF yellow pages The DF yellow pages described in chapter 4 will be used in this MAS to enable Feed erAgents to publih and search for services they require For this application the ser vice a FeederAgent will offer 1s to provide power to other FeederAgents This is used when one FeederAgent has experienced at fault on its feeder It will then search through the 38 MAS Design yellow pages for other a
14. while powerfound false amp amp count no of proposals ListIterator iter Proposals listIterator float total proposed 0 ACLMessage bestmsg new ACLMessage ACLMessage INFORM just initialized int bestdistance 10 The shortest distance from power provider to initiator int distance 1 The distance between this feeder and the others while iter hasNext ACLMessage promsg ACLMessage iter next get sender AID String proposer promsg getSender getLocalName if proposer equals FeederAgent1B distance 1 j else if proposer equals FeederAgent1C distance 2 j else if proposer equals FeederAgent2A distance 3 j else if proposer equals FeederAgent2B distance 4 j else if proposer equals FeederAgent2C distance 5 j else System out println error identifying proposer distance 100 dummy if distance bestdistance S8SyBtem out printin int distance if bestdistance distance bestmsg promsg System out printin bestmsg tbestmsg toString proposal byBest extractContent promsg j j float power left power required power temp System out printin power temp 4power temp System out printin myAgent getLocalName 4bestmsg toString String BestProvider bestmsg getSender getLocalName rejectproposal removeReceiver new AID BestProvider AID ISLOCALNAME
15. A A new AID BusAgentl AID ISLOCALNAME ID ISLOCALNAME ID ISLOCALNAME AID AID AID AID FeederAgentlA AID FeederAgentlPB FeederAgent2A AID FeederAgent2B AID FeederAgentlC AID FeederAgent2C variable the replies from other agents conversation conversation po I Cprgongqu ISLOCALNAME ISLOCALNAME ISLOCALNAME AID ISLOCALNAME AID AID AID AID ALI private static final String STATE 1 1 private static final String STATE 2 2 private static final String STATE 3 3 private static final String STATE 4 4 private static final String STATE 5 5 private static final String STATE 6 6 protected void setup getContentManager registerLanguage codec getContentManager registerOntology ontology Adding FSM behaviour FSMBehaviour fsm public int onEnd System out println FSM behaviour completed myAgent doDelete return super onEnd Ju Register states fsm fsm fsm fsm fsm fsm new new new registerState n registerFirstState new Statel registerState new registerState new registerState n registerState new FSMBehaviour this STATE 1 State2 STATE 2 obateo OIATZE 2 7 otate4 STATE 4 otateot STATE 5 stateo OTATE 6 Register the transitions ISLOCALNAME AID ALIS has to be unique has to be unique e e e
16. Practical experi ence in implementing agent systems in the industry is still low and more experience in producing industrial agent systems in general as well as specifically for the power in dustry 1s needed A significant barrier for a wide spread adoption of agent systems in the power industry is the lack of standards to enable the interoperability between different multi agent sys tems Such set of standards has been in other areas as the IEC 61850 which promotes the interoperability between devices within substations part 2 and the Common Infor mation Model CIM which standardizes the way energy management systems can in terface with each other In this regard FIPA would be an appropriate organization to set standards for agent system interoperability as the organization has already set standards for the way agents should interact through the FIPA interaction protocols One important aspect of multi agent design is the ontology design Currently when a multi agent system is developed the ontology is application specific This prevents in teroperability between two different agent systems To solve this problem Catterson et al 14 propose to create an Upper Ontology which should contain the basics of the power engineering domain 1 e concepts common to all applications within the domain The Upper Ontology could then be extended by developers of different applications within the domain see figure 9 1 Having a standard ontology wou
17. Simulation result after occurrence of line fault at feeder 2C The process of returning to the normal configuration when the fault is cleared in this case the return of voltage at source 1 and the clearance of the line fault at feeder 1C 1s the same way as in fault scenario 1 so this is not described further The restoration process of fault scenario 2 has been illustrated in figure A 6 to A 12 in Appendix A In general the simulation results show that the software performs as expected The tim ing in the interaction 1s nevertheless very important for how the scenario turns out 58 Conclusion 8 CONCLUSION 6 1 Results In this report an approach for applying agent technology to service restoration of a dis tribution network has been presented A restoration strategy for prioritizing certain loads in case of shortage of alternative sources has been proposed A multi agent system has been built using the JADE framework to verify the restora tion strategy Two fault scenarios have been considered to verify the capability of the MAS The test results demonstrates the flexibility of the MAS in terms of dealing with different types of network faults occurring one at a time or simultaneously This project has incorporated ontologies and FIPA protocols in the multi agent sys tem It has been shown how the FIPA Contract Net Interaction Protocol and the FIPA Subscribe Protocol can be used by agents to transfer power between feeders duri
18. agents AID could for instance be peter 1099 laptop where peter is the local name on platform 099 laptop Furthermore the AMS is responsible for creating and deleting agents The DF agent provides a yellow pages service to all other agents By searching the yellow pages one agent can discover other agents which provide a service it requires to achieve its goals An overview is given in figure 4 2 22 The JADE Platform Exploit required service s Figure 4 2 DF yellow pages service Publish TCR bsc Search for E PAs equired services As illustrated in the figure agent A4 A5 and A6 use the yellow pages to search for ser vices published by agent Al A2 and A3 Agent A5 could for instance be interested in buying books a service offered by agent Al who would then publish this service on the yellow pages If the publishing agent A1 decides for whatever reason to stop selling books it can deregister its services from the yellow pages In the next chapter the distribution network used as a case example will be presented before moving on to describing the MAS design in the following chapter 23 The Network Case Study D THE NETWORK CASE STUDY In this chapter the distribution network under study is presented This distribution net work will be used to test and demonstrate the operation of the developed multi agent system A diagram of the network is shown in Figure 4 1 In the system power is provi
19. disconnect tie switch Update current power level yes Any P ds ContractNetlnitiator p eubsenpHons yes v Send out CANCEL ne messages no Power obtained Full power obtained dive Get pre fault power levels for loads Y Calculate how many loads can be connected with the power obtained gt Got all confirms before timeout yes y Cancel subscriptions k Send command to no yes appropriate BA to connect tie switch respective BusAgent to no Request highest disconnect tie switch prioritized BAs to connect their loads EN Y yes Request remaining BAs Got all confirms to disconnect their loads before timeout Got all confirms yes FeederAgent Sane Commando no FiniteStateMachine Behavior Figure 6 10 Got all confirms Flowchart of Finite State Machine Behavior 6 6 2 The ContracNetlnitiator behaviour The flowchart for the ContractNetInitiator behavior can be seen in figure 6 10 6 11 and 6 12 When this behavior is invoked by the FSM behavior it starts out searching for reg 42 MAS Design istered FAs at the DF yellow pages If any 1s found it sends out CFP messages to them otherwise the behavior terminates as seen in figure 6 10 If a message 1s received be fore a given deadline it is checked if the message
20. e Reactivity An agent is reactive by being able to perceive its environment and respond to changes in this environment according to its design objectives e Proactiveness An agent has the ability to perform goal directed behavior by taking the initiative without external stimulus hence it 1s not only reactive e Social ability An agent has a social ability because it communicates with other agents to satisfy its design objectives 17 The Agent Paradigm Having a social ability implies more than just agents passing data to each other Agents are capable of negotiating and interacting with each other This ability 1s facilitated by an Agent Communication Language ACL which will be described in the following section Furthermore an agent s interaction with its peers can be cooperative in order to sat isfy a common goal or competitive serving their own interests In the application of this project service restoration the restoration objective of maximizing the number of re stored loads will only be fulfilled if agents are cooperating in achieving this common goal 3 2 FIPA Agent Communication Language One of the essential abilities for agents in multi agent systems is the ability to commu nicate An agent should be able to communicate with the user s of the system system resources as well as other agents 1 Communication between agents 1s based on spe cific communication languages called Agent Communication Languages ACL
21. import java util Vector import java util ListIterator import java util Enumeration import jade content ContentManager import jade content Predicate import jade content lang Codec import jade content lang Codec CodecException import jade content lang sl SLCodec import jade content onto Ontology import jade content onto OntologyException import jade core Agent import jade core AID import jade core behaviours Behaviour import jade core behaviours CyclicBehaviour import jade core behaviours FSMBehaviour import jade core behaviours OneShotBehaviour import jade lang acl ACLMessage import jade lang acl MessageTemplate import jade proto ContractNetResponder import jade proto SubscriptionResponder import jade proto SubscriptionResponder Subscription import jade proto SubscriptionResponder SubscriptionManager import jade domain DFService import jade domain FIPAException import jade domain FIPANames import jade domain FIPAAgentManagement DPFAgentDescription import jade domain FIPAAgentManagement FailureException import jade domain FIPAAgentManagement NotUnderstoodException import jade domain FIPAAgentManagement RefuseException import jade domain FIPAAgentManagement ServiceDescription public class FeederAgentlA extends Agent float prefaults 0 0 0 0 Initially no prefault values private int distance 1 The distance between this feeder and the others private float current powerleve
22. onLineSectionSchema add LINESECTION LineSectionSchema PredicateSchema isConnectedSchema new PredicateSchema CONNECTED isConnectedSchema add SWITCH SwitchSchema PredicateSchema NeedPowerSchema new PredicateSchema NEEDPOWER NeedPowerSchema add LOAD LoadSchema AgentActionSchema switchInSchema new AgentActionSchema SWITCHIN switchlInSchema add SWITCH SwitchSchema AgentActionSchema switchOutSchema new AgentActionSchema SWITCHOUT switchOutSchema add SWITCH SwitchSchema add SwitchSchema Switch class add LineSectionSchema LineSection class add LoadSchema Load class add FaultSchema Fault class add BusFeederSchema BusFeeder class add onLineSectionSchema onLineSection class add isConnectedSchema isConnected class add switchlInSchema switchIn class add NeedPowerSchema NeedPower class l catch OntologyException oe oe printStackTrace www elektro dtu dk Institut for Elektroteknologi Danmarks Tekniske Universitet rsteds Plads Bygning 348 2800 Kgs Lyngby TIf 45 25 38 00 Fax 45 93 16 34 E mail info elektro dtu dk
23. 6 8 If a message 1s received the information sent by the BusAgent is evaluated If power any power loss at the load is reported the FA will store the pre fault power value In case several loads are left with out power the FA will add these individual pre fault consumption values and go to next state state2 see figure 6 8 In a the FA receives notifications from its BAs that power has returned it will stay in the same state statel but register its services on the DF yellow pages since power has returned Besides if the FA has done any subscriptions with other FAs during the outage period it will cancel these and send request to the appropriate BAs to disconnect the interconnecting switches to these feeders In this state the FA also waits for any subscription cancellations form other FAs Flowchart 6 9 gives a clearer picture of the action taking when such a cancel message is received 39 MAS Design State2 In state 2 the behavior ContractNetInitiator is invoked The flowchart of this behavior can be seen in figure 6 10 to 6 12 When the ContractNetBehavior has been invoked the FeederAgent will move on to state 3 State3 In state 3 the outcome of running the ContractNetInitiator behavior is evaluated If no power has been obtained the FA will return to the idle state state 1 If the required amount of power has been fully obtained it will go to state 5 If it has only been possi ble to restore part of the required power the
24. MessageTemplate MatchConversationId regID step 3 break case 3 System out println myAgent getLocalName In case 3 Receive the power order reply ACLMessage reply myAgent receive mt if reply null power order reply received if reply getPerformative ACLMessage INFORM i1intormCntJd s System out printin myAgent getLocalName h as received INFORM message from reply getSender Initiate subscription myAgent addBehaviour new SubscriptionInitiator reply Update power transfer variable float power agreement extractContent reply l1 power transfer power transfer power agreement j else System out printliln myAgent getLocalName PowerRequest failed Requested power not available from reply getSender if informCnt count All inform msg received step 4 j else block break public boolean done if step 2 amp amp Proposals null oystem out println Arttenpt Tailed tr power regurred refused j return step 2 amp amp Proposals null step 4 j private class SubscriptionInitiator extends Behaviour private int step 0 ACLMessage subreply ACLMessage confirm ACLMessage submsg new ACLMessage ACLMessage SUBSCRIBE null public SubscriptionInitiator ACLMessage confirmmsg confirm confirmmsg public void action Switch s
25. TIET Iterator con submsg getAllReceiver while con hasNext ALD Contractor AID con next if contractor equals FAI1B command addReceiver BA4 switch else if contractor equals FAI1C command addReceiver BA1 switch else if contractor equals FA2A command addReceiver BA4 switch else if contractor equals FA2B command addReceiver BA4 switch else if contractor equals FA2C command addReceiver BA4 switch else SAB SAC T2 To TI System out println myAgent getLocalName No match j j Send out command to the appropriate BusAgent to perform the control action command setConversationIld command myAgent send command j MySubscriptions null clearing vector Registration end else if cancelmsg null handle cancellation from other FAS float power contract current power level CANCEL power Contract tpower contract Current powerlevel extractContent cancelmsg 1 current powerlevel power contract System out println myAgent getLocalName current powerlevel power contract System out println myAgent getLocalName current powerlovel after CANCEL Toc rrent powerlevel String cancelConID cancelmsg getConversationId if MySubscriptions null ListIterator list MySubscriptions listIterator while list hasNext ACLMessage submsg ACLMessage
26. This is illustrated in figure A 6 After this fault a sec 54 Simulation Results ond line fault at feeder 2C occurs which is illustrated in figure A 10 Table 7 3 shows the data used for pre fault load consumption at each bus for fault scenario 2 Table 7 3 Pre fault load consumption values at each bus for fault scenario 2 Load consumption MW on Feeder MW feeder A 1 6 jJ 1 C ee 5 p ee 3 1 Restoration process As source 1 is lost the feeders 1A 1B and 1C is left without power As a consequence FAIA FAIB and FAIC start by deregistering their power service from the yellow pages Thus each of the agents FA1A FAIB and FAIC only initiate negotiations with FAs which are still registered at the DF that is agent FA2A FA2B and FA2C As seen from figure 8 5 FATC is the first FA to initiate a negotiation requesting 290 MW FAIC accept 200 MW from FA2C and 90 MW from FA2B since these feeders are closest to feeder 1C The next FA which sends out CFP messages is FAI A which requests 230 MW to be restored see table 7 3 FAIA gets proposals from FA2A and FA2B but a refusal from FA2C since this FA has just made a contract delivering all its excess capacity to FAIC FA2A proposes 250 MW since the current power flow at feeder 2A is 250 MW FA2B proposes only 210 MW since it has transferred 90 MW to FAIC of its initial 300 MW excess capacity FAIA accepts 230 MW from FA2A since this feeder is closest 55 Simulation Result
27. between them Figure 6 5 Elements of the BusFeederOntology Figure 6 6 Sequence diagram of the Contract Net Interaction Protocol Figure 6 7 Sequence diagram of the FIPA Subscribe Protocol Figure 6 8 Sequence diagram for FIPA Cancel Meta Protocol Figure 6 9 Finite State Machine diagram of the FSM behavior Figure 6 10 Flowchart of Finite State Machine Behavior Figure 6 11 Flowchart for ContractNetInitiator behavior part 1 Figure 6 12 Flowchart for ContractNetInitiator behaviour part 2 Figure 6 13 Flowchart for ContractNetInitiator behavior part 3 Figure 6 14 prepareResponse method of ContractNetReponder Figure 7 1 Simulation part of fault scenario 1 Figure 7 2 Clearance of fault and subsequent return to normal operation Figure 7 3 FAIA and FAIC negotiating with FA2A FA2B and FA2C Figure 7 4 Simulation result after occurrence of line fault at feeder 2C Figure 8 1 An Upper Ontology extended for different power engineering applications FIPA communicative acts Figure A 1 Fault Scenario 1 A line fault on feeder 1A Figure A 2 Fault Scenario 1 FeederAgentlA prepared for restoration Figure A 3 Fault scenario 1 Feeder 1A fully restored by 1B and 1C Figure A 4 Fault Scenario 1 Clearance of fault and subsequently connection of switch SI Figure A 5 Fault Scenario 2 The loss of Sourcel Figure A 6 Fault scenario 2 FAIC has obtained full power from FA2C and FA2B and connected all its loads List Of Figures
28. car from Jens Jensen The use of ontologies in the MAS developed in this project will be described in chapter 6 The next chapter a description of the JADE platform will be given which to a large extent 1s built upon the FIPA specifications presented above 20 The JADE Platform 4 THE JADE PLATFORM The Java Agent DEvelopment framework JADE is considered to be the leading FIPA compliant open source agent framework 1 It supports all the main FIPA specifications described in the previous chapter The software development of JADE was started in 1998 by Telecom Italia with the pur pose of validating the FIPA specifications and subsequently grew to a full middleware used to create multi agent systems JADE consists of a runtime environment to host and execute agents a library consisting of Java classes used to create agents and a graphical user interface to monitor the activity of executing agents In JADE each agent has its own thread of control Message passing is done asynchro nously so there is no dependency between the sending and receiving agent 1 This makes the receiving agent able to choose if and when to perform a given action re quested by the sending agent It enables the sending agent to control its own thread of execution by not being dependent on an answer from the receiving agent Such a loose coupling of agents makes agent systems very fault tolerant One malfunctioning agent will not make and entire agent sy
29. list next String ConID submsg getConversationId if ConlID equals cancelConID MySubscriptions removeElement submsg System out println myAgent getLocalName removed sub submsg toString j j Send control action to disconnect switch ACLMessage command new ACLMessage ACLMessage REQUEST COMmMand SeucConcenit ALeconnecr Tie AID contractor cancelmsg getSender 1f f contractor equals FAI1B command addReceiver BA4 switch SAB else if contractor equals FAI1C command addReceiver BA1 switch SAC else if contractor equals FA2A command addReceiver BA4 switch T2 else if contractor equals FA2B command addReceiver BA4 switch T5 else if contractor equals FA2C command addReceiver BA4 J switoh TI else System out println myAgent getLocalName No match myAgent send command Send reply ACLMessage inform cancelmsg createReply inform setPerformative ACLMessage INFORM myAgent send inform current fOquest Powel OODLEract exitValue 2 else exitValue 1 j j public int onEnd return exitValue j j private class State2 extends OneShotBehaviour private int exitValue public void action In this state a power negotiation is initialized System out println Executing behaviour t getBehaviourName myAgent addBehaviour new RequestPower current request
30. on agent technology 8 In this system control of line segments of the distribution system 1s governed teams Each team consist of an agent called a team coach which 1s responsible for negotiating with each team coaches in order to perform power restoration Peer to peer communication between teams 1s done through radios and fiber optics The IntelliTeam system has been installed successfully in several dis tribution networks However it should be noted that this product 1s not designed ac cording to the FIPA specifications which is recommended to ease interoperability be tween multi agent systems 12 Preface 1 6 How to read the report This report is divided in eight chapters and four appendices In Chapter 2 an introduc tion to service restoration in distribution systems is given In Chapter 3 I give an over view of the agent paradigm and the specifications layed out by the Foundation for Intel ligent Agents FIPA to support agent oriented programming Chapter 4 gives a de scription of the key elements of the Java Agent DEvelopment Framework JADE the software platform used for development of the MAS in this project In Chapter 5 I briefly present the distribution network used as a basis for testing the MAS which is necessary before explaining the MAS design in the following chapter In Chapter 6 I describe the design choices I have made during the development of the multi agent sys tem design including the agent architecture th
31. prefaults 0 Float parseFloat busmsg getContent j else if BusID equals BA2 BA2 online false BA2 prefault Float parseFloat busmsg getContent prefaults 1 Float parseFloat busmsg getContent j else if BusID equals BA3 BA3 online false BA3 prefault Float parseFloat busmsg getContent prefaults 2 Float parseFloat busmsg getContent j else if BusID equals BA4 BA4 online false BA4 prefault Float parseFloat busmsg getContent prefaults 3 Float parseFloat busmsg getContent j if BAl equals busmsg getSender BA1 informs that switch S1 is disconnected so no power then deregister The generator is down try DFService deregister myAgent System out println myAgent getLocalName is deregistered doWait 1000 doWake j catch FIPAException fe fe printStackTrace j j busmsg count tt System out println buscount kbusmsg count float load power Float parseFloat busmsg getContent current powerlevel current powerlevel Logo power current request Current request load power if busmsg count 4 only if all four buses are down exitValue 2 j j else if busmsg getEncoding equals voltage up The generator is up again and registers its services cancel any subscriptions System out println myAgent getLocalName startup current power level Current powsrle
32. 7 July 2008 Webster J Power System Restoration Wiley Encyclopedia of Electrical and Electronics Engineering Wiley amp Sons 1999 R Feuillet et al Analysis and control of a temporary overvoltages for auto mated restoration planning EEE Trans Power Delivery vol 17 no 4 Oct 2002 Inagaki J et al A Multi Objective Service Restoration Method for Power Distribution Systems IEEE 2002 McArthur S et al Multi Agent Systems for Power Engineering Applications Part I Concepts Approaches and Technical Challenges IEEE Transactions on Power Systems Vol 22 No 4 November 2007 McArthur S et al Multi Agent Systems for Power Engineering Applications Part II Technologies Standards and Tools for Building Multi Agent Sys tems IEEE Transactions on Power Systems Vol 22 No 4 November 2007 V M Catterson E M Davidson and S D J McArthur Issues in integrating existing multi agent systems for power engineering applications in Proc 13th Int Conf Intelligent Systems Application to Power Systems 2005 63 Conclusion 15 http www cwlp com electric division t d power restore priority htm 1 of august 2008 16 Dimeas et al A Multi Agent System for Microgrids National Technical Uni versity of Athens Department of Electrical and Computer Engineering 64 A FAULT SCENARIO DIAGRAMS Fault Scenario 1 Normal Line Source1 Ch Operation fault CY FA1A sg BA
33. 86 sAgent24 Agents BusAgent24 FeederAgentl A Agents FeederAgent A Feeder AgentlIB Agents FeederAgentIl B FeederAgentl C Agents FeederAgentlC Feeder Agent2A Agents FeederAgent2A FeederAgent2B Agents FeederAgent2B Feeder Agent2C Agents FeederAgent2C For fault scenario 2 paste the following code into the prompt java jade Boot detect main false gui BusProxy2C Agents SocketProxyA gent BusProxy1B1C Agents SocketProxyAgentl BusProxylA Agents SocketProxyA gent BusProxyBottom Agents SocketProxyAgent BusAgentl Agents BusAgent Bu sAgent2 Agents BusAgent2 BusAgent3 Agents BusAgent3 Bu sAgent4 Agents BusAgent4 BusAgent5 Agents BusAgent5 Bu sAgent6 Agents BusAgent6 BusAgent7 Agents BusAgent7 Bu sAgent8 Agents BusAgent8 BusAgent9 Agents BusAgent9 Bu sAgent10 Agents BusAgentl10 BusAgentl1 Agents BusAgent 1 Bu sAgent12 Agents BusAgent12 BusAgent13 Agents BusAgent13 Bu sAgentl4 Agents BusAgent14 BusAgentl5 Agents BusAgentl5 Bu sAgentl6 Agents BusAgentl6 BusAgentl7 Agents BusAgentl7 Bu sAgentl18 Agents BusAgent18 BusAgentl19 Agents BusAgent19 Bu sAgent20 Agents BusAgent20 BusAgent21 Agents BusAgent21 Bu sAgent22 Agents BusAgent22 BusAgent23 Agents BusAgent23 Bu sAgent24 Agents BusAgent24 FeederAgentl C Agents FeederAgentlC Feeder Agent2A Agents FeederAgent2A FeederAgent2B Agents FeederAgent2B Feeder Agent2C Agents FeederAgent2C JADE should now be started and the JADE GUI should be opened In the JADE GUI open the Sniffer agent GUI s
34. 9 S10 BA10 S11 BA11 S12 BA12 T1 T2 T9 BA21 S21 BA22 S23 BA23 S24 BA16 BA20 BA24 FA2A S16 S20 sac ae FA2B Load Switch connected closed Load B Switch disconnected open Source2 Figure A 1 Fault Scenario 1 A line fault on feeder 1A Normal Operation dd FA1A S1 FA1B S9 BA1 BA9 L L 2 10 BA2 BA10 L L S3 S11 SBC BA3 BA7 BA11 L L L S4 __ S8 12 SAB BA4 BA8 BA12 L L T1 T2 T3 T4 T5 T6 T7 T8 T9
35. ACLMessage order new ACLMessage ACLMessage ACCEPT PROPOSAL if power left gt 0 Still need more power a2 propcsal DyBest gt power leit proposal is more than power left we need powerfound true Order filiContent order string valucOr power Jett localload priority J PELOLALY Js One j else accept full amount power temp power temp proposal byBest order raililContent order otring valueOf proposal byBest localload priority priority is one Order setProtocol FIPANames InteractionPrOtocol FIPA CONTRACT NET order setConversationId reqID order addReceiver new AID BestProvider AID ISLOCALNAME myAgent send order Proposals removeElement bestmsg COUDETT j JZ0ystem out printin out of lo0D 3 rejectproposal setConversationld reqID System out printin rejectproposal toString myAgent send rejectproposal step 3 j else step 4 System out println myAgent getLocalName only got refusals returning to main j j else if currentTime gt deadline step 4 returning System out println myAgent getLocalName got no messages returning to main System out printin currentTime currentTime System out printin deadline deadline break case 2 System out println myAgent getLocalName In case 2 mt MessageTemplate and MessagelTemplate MatchProtocol FiPANames InteractionPrOtocol FIPA CONTRACT NET
36. DE can be started the system path has be set to point to the folders containing the appropriate classes This can be done in several The simplest is to use a batch file to specify the path On the CD ROM the batch file are located at the directory Code Agents bin 1 Go to that directory and open the classpath jadetext txt file Modify this file to cor respond to your directory placements Save the file as a bath file 2 Start a command prompt Go to the directory Code Agents bin 3 Fill in setup inputs for one of the two scenarios and press enter For fault scenario 1 paste the following text into the prompt java jade Boot detect main false gui BusProxy1B1C Agents SocketProxyA gent BusProxyBottom A gents SocketProxyA gent BusProxylA Agents SocketProxyAgent BusAgentl Agents BusAgentl Bu sAgent2 Agents BusAgent2 BusAgent3 Agents BusAgent3 Bu sAgent4 Agents BusAgent4 BusAgent5 Agents BusAgent5 Bu sAgent6 Agents BusAgent6 BusAgent7 Agents BusAgent7 Bu sAgent8 Agents BusAgent8 BusAgent9 Agents BusAgent9 Bu sAgent10 Agents BusAgentl10 BusAgentll Agents BusAgentl Bu sAgentl12 Agents BusAgent12 BusAgent13 Agents BusAgent13 Bu sAgentl4 Agents BusAgentl4 BusAgentl15 Agents BusAgentl5 Bu sAgentl6 Agents BusAgentl6 BusAgentl7 Agents BusAgentl7 Bu sAgent18 Agents BusAgent18 BusAgent19 Agents BusAgent19 Bu sAgent20 Agents BusAgent20 BusAgent21 Agents BusAgent21 Bu sAgent22 Agents BusAgent22 BusAgent23 Agents BusAgent23 Bu
37. Danmarks Tekniske Universitet Jakob Stig Ravn A Multi Agent Approach for Distribution System Restoration Bachelor s Thesis July 2008 DTU Elektro A Multi Agent Approach for Distribution System Restoration This report was drawn up by Jakob Stig Ravn Supervisor s Professor Morten Lind Ph d Arshad Saleem DTU Elektro Center for Elteknologi CET Danmarks Tekniske Universitet Elektrovej 325 2800 Kgs Lyngby Danmark www elektro dtu dk cet Tif 45 45 25 35 00 Fax 45 45 88 61 11 Release date 1 of August 2008 Category 1 offentlig Edition 1st edition Comments This report is part of the requirements to achieve the Bachelor s Degree at the Technical University of Denmark This report represents 15 ECTS points Rights Jakob Stig Ravn 2008 Abstract ABSTRACT This report documents the work carried out during the spring semester 2008 The pro ject deals with the application of a multi agent system MAS for service restoration in distribution power systems In this project the part of the service restoration process which deals with restoring power to consumers in case of an outage 1s considered A restoration strategy based on agent technology has been formulated This strategy proposes a method for prioritizing certain consumers as part of the restoration process A multi agent system has been developed in JADE a software framework specifically suited for the development of agent soft
38. FA will attempt to prioritize its loads by going to state 4 as shown on the figure State 4 Based on the amount of power which has been obtained the FA will decide on how many of the loads it is possible to restore It will request each BA to either connect or disconnect its load When all BAs have informed the FA that the action has been per formed it will go to state 5 see figure 6 8 State 5 In this state the FA will decide on which switch should be connected to get the power from the contractor This could be a tie switch or a switch Depending on from which other FA s the power is to be provided the FA will request one of its BAs closest to the switch to connect it When the BAs have informed that the actions have been performed successfully the reconfiguation is now complete and there fore the FA will return to the idle state state 1 40 MAS Design FeederAgent FSM Behaviour oltage down o CN e Mo power obtained Load shedding not possible Power partly obtained ctions confirmed Full power obtained actions confirmed Figure 6 9 Finite State Machine diagram of the FSM behavior 4 MAS Design Bus notification received yes Cancel msg Voltage ok received no Y Send command to Deregistrate service with Registrate service from respective BusAgent to DF DF
39. IB proposes to deliver 220 MW while FAIC propose to deliver 210 MW After evaluating the proposals FAIA choose to accept the 220 MW from FAIB since feeder 1B is closest to feeder 1A and the remaining 30 MW from FAIC The rest of the proposals are rejected Since FAIA has obtained the full amount required it requests all its BAs to switch in their loads In the next step of the process which is not shown on the figure FATA requests BA and BA4 to switch in SAB and SAC respectively in order to connect feeder 1A to feeder 1B and 1C The pre fault power at feeder 1A has now been fully restored as shown in figure A 4 22 Simulation Results REQUEST O12 12 a AE RN NENNEN TT RN S B EE TTE NN mud oes MEN POSEG AIA Sa eceiving repli MM weed PROPOSES ATA 337 Jo E Accepting proposals fromiB and 1C e ROPOSRLR AIA ROCEPT PROPCLALS RA i I meletTPROPOSALO i Rejecting rest of proposals e e R NFU ga 094 iA 093 Subscribing with contractors E SUBSCRIBER ATA ashen MA 109 REQUEST and _ Sena Requesting to switch in their loads CONFIRMED TER Figure 7 1 Simulation part of fault scenario 1 Search through the OF At some time t after the reconfiguration the fault at feeder 1A 1s cleared Through its measurement devices BAI will detect the return of voltage at this line section and con nect switch S1 This situation 1s shown in Fi
40. REQUEST shedload addReceiver BAIDs 1i shedload setcContent disconnect load Spnedload setconversatriondsd load command myAgent send shedload exitValue 6 public int onEnd return exitValue private class State5 extends OneShotBehaviour private int exitValue public void action System out println myAgent getLocalName Executing behaviour getBehaviourName full amount achieved Send out switching command to BusAgents to switch in loads int i For 1 0 1 lt 4 1 ACLMessage connectload new ACLMessage ACLMessage REQUEST connectload addReceiver BAIDs i Connect lOaGsselLContlent connec aaa connecrtload setConversationid load command myAgent send connectload exitValue 6 public int onEnd return exitValue private class State6 extends OneShotBehaviour private int exitValue public void action System out printin myAgent getLocalName Executing behaviour getBehaviourName Send out switching action commands to correct BAs if MySubscriptions null int size MySubscriptions size System out println myAgent getLocalName subCnt subsCnt System out println myAgent getLocalName size size System out println myAgent getLocalName informCnt informCnt if size informant not all subs have been added yet informCnt 0 reset variable Listlterator list MySubscrip
41. abi sta tes ccs voces c T m d I eae 11 T 3PPOICGEODICCUVES aaa a N eae 11 ES PersongLtnotrvallOT oe etse eit tra e terti aft etus Pio us tastes fied Pisos 11 1 4 Method limitation and background cece ecccccseecceeeeeeceeaeeceeeeeeceeaeeeeeeeeeeeees 12 DS Teelated WORK onra e n Riese Denn arte ns tbau ist tanen Haut eteguasen ween 12 VOFOW 10 Tead ule 1 DO air a uence 13 2 Introduction to Distribution System Restoration e eee e eee eee eene nen 15 SEMIS suci isi 17 Sd Chatactermsucs OF ail age ll udis ise tit a eed ta e petet iam eas 17 3 2 FIPA Agent Communication Language cccccccccccssecceeecceeeescceseeecesaeeceeaaes 18 SEU m 20 2 Phe JADE Plator i iei oci Peto ta Codex v EE va esa ede Deve aeo Deoa e Eu ee vv aasa Deae Tess 21 J h Network ase Siudy osora REESE ED IE aaa oim UE 24 OMAS DeSiO mess E 28 Geleen Ar hitee Ute setate bebes OE Id nes Cei Ee Mn E Dar 28 0 2 Systetiiareblte o UE vio basim etta Dassin eden TURA sx wae 30 6 T rrreleru e E T UTE 33 OF PEOIOGOIS ico tno EH REM PN MM DM E MU DU 35 OO TG CdOrAPeHD de SIODE esce era eM M EM AM EMI UM ID I LED 38 SON RESIOPAMOM SW ALC OY NR EO TEE 39 7 smiulation Results osissa ue Eis Due e ves eaa xo Ee PE M Quae Fade o VU vidU Un ORE RUDI 50 TA Priori za non IIS ETE 50 T2 Fault seenatio de SIMO e tau sect I REND TIE etu o Un ado 50 4 2 PAU SCenarlO 2 Mule TAUIS ase t RR te
42. accept the amount which is needed Otherwise it will accept the full amount update the power amount obtained so far and go through the list again The initiator will go through the list this way until the full amount of power has been obtained or there are no more pro posals in the list It will then go to the next step to wait for INFORM messages from the proposers it has send ACCEPT PROPOSAL messages to as shown in figure 6 11 43 MAS Design ContractNetlnitiator Behaviour Search for registered FAs Successful yes 3 Send CFP message to FAs found Received a reply Got proposal yes l Store proposal Increment no of replies Timeout yes Got any 44 no proposals yes MAS Design Figure 6 11 Flowchart for ContractNetInitiator behavior part 1 Get list of proposal messages Evaluate each proposal Y Choose the best proposer Y Update power amount obtained so far Full amount obtained no yes proposal gt power left E yes Accept full amount from best proposer i Accept only amount needed Update power amount obtained so far v Send ACCEPT PROPOSAL to best proposer i Remove proposal from list ore power needed and more ropos
43. agent actions The concepts represent the elements relevant for the BusAgent that 1s the physical com ponents surrounding the BusAgent like load line section and switches Besides these concrete things a fault is also considered a concept although being abstract As de picted in the figure each concept can consist of one or more subconcepts For instance the information necessary to describe the status of a load 1s loadnumber voltagelevel and powerlevel Predicates offer a way to express the status of the world by indicating the relation be tween concepts One responsibility of the BusAgent is to notify the FeederAgent in case of fault events This 1s done with the predicate onLineSection If a line fault has oc curred at line section number 3 the BusAgent will send the following predicate to the FeederAgent onLineSection LineSection sectionnumber 3 Fault faulttype linefault Information about the location of a fault and the type of fault 1s important to the Feed erAgent in order to make any conclusions about how many of the BusAgents on the feeder 1s affected by the fault 33 MAS Design BusFeederOntology Concepts r LineSection Sectionnumber I Fault Faulttype Switch Switchnumber Load Loadnumber Powerlevel Voltagelevel I Predicates isConnected Switch jsDisconnected
44. agents the participants The initiator sends out a Call For Proposal CFP message which specifies the task to be performed to m participants The participants can then choose to submit a proposal to perform the action or they can refuse They would typically refuse if they are not able to perform the action e g to provide the amount of power which the initiator requests The initiator has set up a deadline for receiving replies and when that is passed it selects one more or none of the proposals received It might not get any replies at all or only refusals so such situa tions should be taken care of In case it gets one or more proposals it accepts one or more of them and rejects the rest A participant which receives an ACCEPT PRO POSAL from the initiator returns an INFORM if the action has been performed success fully or a FAILURE if they fail to The participants which proposals the initiator chooses to accept 1s from now on called the contractors 35 MAS Design FIPA Contract Net Protocol Initiator Participant rn refuse r j2sn i propose 2 e reject proposal kj accept proposal K failure inform done inform inform result inform Figure 6 6 Sequence diagram of the Contract Net Interaction Protocol The FIPA Subscribe Protocol can be used when one agent wants to subscribe on getting certain information from one or more other agents The sequence diagram for the Sub scribe P
45. al structure in the network during restoration This structure can be enforced whenever possible by assigning distances between the six feeders The values used for the simulations can be seen in table 5 2 say that feeder 1A can be connected with one of the feeders 1B 1C and 2A Feeder 1A should be connected to the feeder closest to it which according to table 1A is feeder 1B with the distance 1 The feeder least desirable for feeder 1A to interconnected to is feeder 2C with a distance of 5 24 The Network Case Study Table 5 1 Distance values between the feeders 25 The Network Case Study Normal Operation Source 1A ES L S10 L S11 L S12 L T1 T2 T9 L S13 S17 S21 L L L S14 S18 S23 SBC 3 L L 15 19 24 L L S16 S20 S25 2A 2B SAC 20 Load Switch connected closed Sou rce2 Load E Switch disconnected open Figure 5 1 Distribution network in normal operation 26 The Network Case Study 27 MAS Design 6 MAS DESIGN Some of the key b
46. als no Y Send REJECT PROPOSALS to remaining proposers on the list Figure 6 12 Flowchart for ContractNetInitiator behaviour part 2 45 MAS Design Reply received yes Got INFORM es message y Update powertransfer variable Y Subscriptionlnitiator Increment no of replies received Got all replies yes end Figure 6 13 Flowchart for ContractNetInitiator behavior part 3 46 MAS Design 6 6 3 The ContractNetResponder Behavior The ConctractNetResponder behavior consists of a set of methods to handle messages part of a Contract Net Interaction Protocol Each method handles specific messages as CFP INFORM etc For this application the method prepareResponse is the most inter esting as it evaluates incoming CFP messages from other FeederAgents Figure 6 13 shows the flowchart for the prepareResponce method of the Con tractNetResponder behaviour This method is invoked whenever the agent receives a Call For Proposal message The FA will measure the current power flow on the feeder that is the collective power consumption of its loads if it 1s not interconnected with other feeders It will then calculate its excess capacity which is the difference between its maximum allowable power flow and its current power flow If it has not reached its limit it will evaluate the CFP message received oth
47. an the interaction between a multi agent system and a model of a distribu tion network be simulated 1 3 Personal motivation My personal motivation for carrying out this project has been an interest in acquiring knowledge about agent systems and the application of agent technology in society Furthermore it 1s interesting to investigate the application of agent technology to a power industry application as this industry 1s undergoing many changes these years in the way power is generated traded and distributed This development opens up new possibilities for employing technologies like MAS in the industry 11 Preface 1 4 Method limitation and background The focus of this project has been to develop a multi agent system for a power distribu tion system capable of performing service restoration The current stage of applying agent technology in the power industry has been researched It has been researched which software tools exists for developing and simulating agent systems The frame work JADE was selected for building the MAS as this is a software framework suited specifically for developing agent systems and used by the majority of the agent commu nity today The JADE platform is described in chapter 4 The capability of the MAS developed in JADE has been demonstrated by observing the systems response to two different fault scenarios A simple distribution network has been used as basis for the tests One of the objectives of th
48. ative ACLMessage REFUSE refuse setProtocol FIPANames InteractionProtocol FIPA SUBSCRIBE myAgent send refuse L o Setup end Put agent clean up operations here protected void takeDown Deregister from the yellow pages try DFService deregister this catch FIPAException fe fe printStackTrace Printout a dismissal message System out println agent getAID getName terminating private class Statel extends OneShotBehaviour private int exitValue public void action Here the messages should be received System out printin Executing behaviour getBehaviourName Receive only messages from BusAgents MessageTemplate template MessageTemplate and MessageTemplate Matchoconversastrionlid bus noLtrrioarron MessageTemplate MatchPerformative ACLMessage INFORM MessageTemplate subcancel MessageTemplate and Messageremplate MatochProtocol FIPANames InteractionProtocol FIPA SUBSCRIBE MessageTemplate MatchPerformative ACLMessage CANCEL ACLMessage busmsg myAgent receive template ACLMessage cancelmsg myAgent receive subcancel if busmsg null Registering or deregistering this connection it busmsg getsncoding equals voltage down System out printin myAgent getLocalName t got BA1 encode AID BusID busmsg getSender if BusID equals BA1 BAl prefault Float parseFloat busmsg getContent
49. cC D Ve core core core core core domain domain domain domain domain domain domain domain ContentManager Concept Predicate Lang Codec lang Codec CodecException lang sl SLCodec Onto Oncology onto OntologyException D l ACLMessage l MessageTemplate Date Enumeration stIterator ctor JAGgernc behaviours behaviours behaviours behaviours Behaviour CyclicBehaviour FSMBehaviour OneShotBehaviour DFService FIPAException BIPANdAmTOSI FIPAAgentManagement DFAgentDescription FIPAAgentManagement FailureException FIPAAgentManagement NotUnderstoodException FIPAAgentManagement RefuseException FIPAAgentManagement ServiceDescription class BusAgentl extends Agent private private private private float power measure boolean switch closed Codec codec Ontology busfeederontology 50s false new SLCodec BusFeederOntology getInstance protected void setup getContentManager registerLanguage codec getContentManager registerOntology busfeederontology addBehaviour new CyclicBehaviour this public void action MessageTemplate template MessageTemplate and MessageTemplate MatchConversationlId loadalert MessageTemplate command MessageTemplate MatchPerformative ACLMessage INFORM MessageTemplate and MessageTemplate MatchConversationlId command MessageTemplate loadcmd MessageTempla
50. d send it to JADE This were done by setting up a TCP IP client server socket where Matlab functions as a client and JADE as a server This process 1s illustrated in figure B 1 Some of the Embedded Matlab function blocks were used only to take data measurements from the Simulink to the MAS in JADE like the load and source embedded function blocks The negotiation takes places between the correspond ing agents in JADE as a control action is passed back to a breaker embedded function block in Simulink see figure LoadAgent Matlab Simulink model SourceProxy SourceAgent actions BreakerProxy BreakerAgent Figure B 1 Data transfer between Matlab and JADE A simple network was built in Simulink to test the interaction between the MAS in JADE and this model An illustration of this network is seen in figure B 2 The network 76 consists of two voltage sources a load and two breakers One of voltage sources source B is simulated to fail in the Simulink model Since data is sent continuously to the agents in JADE this event will be detected and the breaker S5 will be switched 1n to restore voltage to the load from the secondary source C SourceAgentB BreakerAgentS5 L Fault Rr oai LoadAgent2 Figure B 2 Illustration of simple network to test data passing bet
51. ddReceiver PowerGeneratingAgents i deadline System currentTimeMillis 2000 Taking the current time and specifying deadline c p til lCentent crop otring valuecor power requared localload priority cfp setConversationlId reqID myAgent send cfp Prepare the template to get proposals PROPOSE as well as REFUSE mt MessageTemplate and Messagelemplate MatchProtocol RFiPANames InteractionProtocol PFIPA CONTRACT NET MessageTemplate MatchConversationId reqID step 1 case 1 Receive all proposals refusals from other agents System out println myAgent getLocalName In case 1 ACLMessage cfpreply myAgent receive mt if cfpreply null Reply received if cfpreply getPerformative ACLMessage PROPOSE This is an offer no of proposalstt if Proposals null Proposals new Vector j Proposals addElement cfpreply Adding the proposal msg System out printin distance Distance System out println myAgent getLocalName Got proposal rejectproposal addReceiver cfpreply getSender System out printin in cfpreply trejectproposal toString j repliesCntt Both PROPOSE and REFUSE will be counted j long currentTime System currentrlimeMilli5 if repliesCnt gt PowerGeneratingAgents length currentTime gt deadline amp amp Proposals null if Proposals null float power temp 0 boolean powerfound false
52. ded from two sources Sourcel and Source2 each through a distributed transformer Each transformer provides power to three feeders A B and C where each feeder includes four buses each having a load attached Switches are symbolized with a square symbol in the diagram where a black filling denotes that the switch is close while a white fill ing symbols an open switch All feeders are connected with each other making it possible to reconfigurate the network in numerous ways Each feeder is connected with the other feeders fed from the same source through the switches denoted SAB SBC and SAC In addition all feeders are connected with feeders from the other source though the tie switches T1 T9 On each feeder every bus is separated by a switch making it possible to isolate one or more buses of the feeder 1f necessary In normal operating conditions of the network all these sectionalizing switches are closed as shown in the figure Transmission lines impose constraints on how much power can be transmitted For the sake of simplicity each feeder has been assigned a maximum allowable MW flowing through it This will limit the amount of load which can be connected to the feeder in addition to its own loads How much a feeder can provide to another feeder then de pends on its current load consumption A power flow capacity of 500 MW will be used for all feeders in the subsequent simulations As mentioned in chapter 2 it 1s desirable to keep a radi
53. dpower The singleton instance of this ontology private static Ontology theInstance new BusFeederOntology Retrieve the singleton Book trading ontology instance public static Ontology getInstance return theInstance j Private constructor private BusFeederOntology The Book trading ontology extends the basic ontology super ONTOLOGY NAME BasicOntology getInstance try PrimitiveSchema booleanSchema PrimitiveSchema getSchema BasicOntology BOOLEAN PrimitiveSchema stringSchema PrimitiveSchema getSchema BasicOntology STRING PrimitiveSchema integerSchema PrimitiveSchema getSchema BasicOntology INTEGER PrimitiveSchema floatSchema PrimitiveSchema getSchema BasicOntology FLOAT ConceptSchema SwitchSchema new ConceptSchema SWITCH SwitchSchema add SWITCHNUMBER integerSchema ConceptSchema LineSectionSchema new ConceptSchema LINESECTION LineSectionSchema add SECTIONNUMBER integerSchema ConceptSchema LoadSchema new ConceptSchema LOAD LoadSchema add LOADNUMBER integerSchema LoadSchema add VOLTAGELEVEL integerSchema LoadSchema add POWERLEVEL stringSchema ConceptSchema FaultSchema new ConceptSchema FAULT FaultSchema add FAULTTYPE integerSchema PredicateSchema BusFeederSchema new PredicateSchema BUSFEEDER PredicateSchema onLineSectionSchema new PredicateSchema ONLINESECTION onLineSectionSchema add FAULT FaultSchema
54. e vices FeederAgent FeederAgent commands notifications commands notifications BusAgent BusAgent control actions measurements control actions measurements Switching Control Power flow Switching Control Power flow Devices measurement devices Devices measurement devices Figure 6 4 The layered structure of the multi agent system and the control and data flow between them As seen from the figure negotiations can only take place at the decision layer and not between BusAgents which only permit a BusAgent to report to one FeederAgent Peer to peer negotiations between BusAgents could be desirable if BusAgents should have autonomy to provide or request power from other BusAgents However if BusAgents were capable of negotiating with each other it would lead to a substantial increase in communication among the agents which would require additional computational re 32 MAS Design sources By gathering information from several BusAgents at one FeederAgent com munication between agents is reduced to a smaller number of agents 6 3 Ontologies As outlined in section 3 2 ontologies provides a way to structure information for several agents to understand it In this project an ontology has been created to structure infor mation transferred between BusAgents and FeederA gents The structure of this ontol ogy called the BusFeederOntology is shown in figure 6 4 The ontology consists of number of concepts predicates and
55. e int repliesCnt 0 Count the replies from other agents private MessageTemplate mt The template to receive replies private float power proposal used in two states private AID PowerGeneratingAgents private int no of proposals 0 private ACLMessage rejectproposal new ACLMessage ACLMessage REJECT PROPOSAL Vector Proposals null public RequestPower float power this power required power step 0 j public void action switch step case 0 Send the cfp to other agents ACLMessage cfp new ACLMessage ACLMessage CFP cip serProtocol FI PANanes Interact1onProvocol FIPA CONTRACT NET System out println myAgent getLocalName In case 0 Update the list of power generating agents DFAgentDescription template new DFAgentDescription ServiceDescription sd new ServiceDescription sd setType PowerGeneration template addServices sd try DFAgentDescription result DFService search myAgent template System out println Found the following power generating agents PowerGeneratingAgents new AID result length for int i 0 i lt result length i if result i getName equals myAgent getName else PowerGeneratingAgents i result i getName System out println PowerGeneratingAgents i getName catch FIPAException fe fe printStackTrace for int i 0 i lt PowerGeneratingAgents length i cfp a
56. e protocols utilized as well as a more detailed description of the software Chapter 7 presents the fault scenarios used for testing the operation in the simulations Chapter 8 presents the results of the tests per formed in JADE In Chapter 9 I summarize what has been carried out during this pro Ject as well as future directions of this work Furthermore I discuss the future perspec tives of employing agent technology in the power industry Appendix A contains network diagrams for the two fault scenarios depicting the resto ration process Appendix B gives a description of the work done in this project con cerning the connection of the MAS in JADE with a physical model in Matlab Simulink Appendix C contains flowcharts associated with the MAS software Appendix D con tains FIPA figures for chapter 3 Appendix E contains a user manual for running the MAS software and the source code for the MAS and Matlab scripts can be seen in Ap pendix F 13 2 INTRODUCTION TO DISTRIBUTION SYSTEM RESTORATION Modern power systems are in general considered to be highly reliable However with the restructuring of the electric power industry towards a market based business envi ronment pressure to reduce costs has increased and as a result power systems are oper ated closer and closer to their limits 6 This development has led to an increasing number of blackouts 10 In case of an outage the utility companies perform service restoration Service
57. elect the number of agents you want to monitor the communication between prefera bly all the FeederAgents Place the Matlab script files in your Matlab work directory Start Matlab and go to this directory Run one of the FaultScenario scripts When doing this the MAS restoration process should be visible in the Sniffer Agent GUI Run the corresponding script for normal operation 1 g for fault scenario 1 run the script NormalOp FSI When doing this the MAS should perform actions to return to normal in the Sniffer GUI 87 F JAVA AND MATLAB SCRIPT SOURCE CODE Embedded Matlab function code Embedded function for Source C function y send2 P Q v This function sends measured real power and reactive power to its agent if v gt 0 2 Sas long as gt than 10e 5 measure power until loss of volt age and power loss P strenum2strib oe Create TCP IP object t Specify server machine and port number topipi logcalhost 1003 ct oe Set size of receiving buffer if needed set t InputBufferSize 30000 oo Q 6 Open connection to the server fopen t 6 Transmit data to the server or a request for data from the server fEprinti ty P str 6 Disconnect and clean up the server connection fclose t delete t y l s1gnal that data i8 being send else y 0 data not send end end 88 Java Source Code FeederAgent class 89 package Agents import java util Iterator
58. elmsg null float power contract extractContent cancelmsg 1 current power level Current powerl evel power Contract System out println myAgent getLocalName CANCEL power contract St oOWer DODLESCL S Current Power level current powerlevel power contract System out println myAgent getLocalName OUEIGNE DDWOEIPIGVOl arter CANCEL current powerleve String cancelConID cancelmsg getConversationId if MySubscriptions null ListIterator list MySubscriptions listIterator while list hasNext ACLMessage submsg ACLMessage list next String ConID submsg getConversationId if ConID equals cancelConID MySubscriptions removeElement submsg System out println myAgent getLocalName removed sub submsg toString j j Send control action to disconnect switch ACLMessage command new ACLMessage ACLMessage REQUEST colimand SerContent disconnect tie AID contractor cancelmsg getSender if contractor equals FAI1B command addReceiver BA4 switch SAB else if contractor equals FAI1C command addReceiver BA1 Z8WItohn SAC else if contractor equals FA2A command addReceiver BA4 switch T2 else if contractor equals FA2B command addReceiver BA4 J fswitcn T5 else if contractor equals FA2C command addReceiver BA4 J switcen TI else System out println myAgent getLocalName No match
59. enefits of applying MAS technology in power systems applications are flexibility and extensibility 12 An agent system is flexible if 1t 1s able to respond correctly to dynamic situations and extensible if it can be expanded easily added new functionality and modified 6 1 Agent architecture The agent architecture 1s important when creating flexible and extensible multi agent systems Several approaches to agent architectures have been proposed in literature 1 6 1 The BDI architecture One of them is the Belief Desire Intention BDI architecture wherefrom the Proce dural Reasoning System PRS is a well known extension The PRS architecture 1s based on four data structures Beliefs Desires Intentions and Plans An agent s beliefs represent the information the agent has about its environment the desires are the agent s goals and intentions represent desires that the agent has committed to achieving 1 An agent s plans is the actions it will perform to achieve its intentions As seen in figure 6 1 an interpreter binds the data structures together and is responsible for updating beliefs based on new sensor input and choosing actions from the plan library based on that Many agent systems have been implemented with the use of the BDI architectures 1 te ee Beliefs Plan library SJosueg SJo enjov Interpreter Intentions Figure 6 1 The PRS architecture 28 MAS Design The BDI architecture relies on a symbolic r
60. ent that the first agent no longer has the intention that the second agent performs some action The action of calling for proposals to perform a given action The sender informs the receiver that a given proposition is true where the receiver is known to be uncertain about the proposition The sender informs the receiver that a given proposition is false where the receiver is known to believe or believe it likely that the proposition is true The action of telling another agent that an action was attempted but the attempt failed The sender informs the receiver that a given proposition is true A macro action for the agent of the action to inform the recipient whether or not a proposition is true A macro action allowing the sender to inform the receiver of some object believed by the sender to correspond to a specific descriptor for example a name The sender of the act for example 7 informs the receiver for example j that it perceived that performed some action but that 7 did not understand what just did A particular common case is that tells 7 that i did not understand the message that j has just sent to z The sender intends that the receiver treat the embedded message as sent directly to the receiver and wants the receiver to identify the agents denoted by the given descriptor and send the received propagate message to them The action of submitting a proposal to perform a certain action given certain preconditions The se
61. epresentation of the world using modal logic If hardware resources of the system are sparse a symbolic representation of knowledge can be too slow to meat certain time constraints 7 This has led some re search to abandon the symbolic representation approach and propose another type of architecture the so called ayered architecture 1 6 2 The layered architecture A layered architecture consists of a number of layers each representing a behavior of the agent An agent designed on the basis of a layered architecture 1s also called a hybrid agent since it consists of both reactive and proactive behaviors An Agent which is purely reactive is only able to react to any changes in their environ ment and thus does not proactively try to achieve a set of goals The layered designed agent typically has lower level behaviors as reactive behaviors which propagate changes to higher level behaviors which then decide on an action to choose Figure 5 1 shows the principle of horizontal and vertical layered architectures Horizontal One pass vertical layered layered Sensors Sensors Actuators Layer 1_ i SJo Eenjov Actuators Two pass vertical layered Figure 6 2 Layered agent architectures In a horizontal layered architecture each software layer 1s directly connected to the sen sor input and the action output 1 e each behavior take in measurements from the envi ronment and decides on some acti
62. er 1s shown in table 7 1 This prioriti zation will be used by the FeederAgent in case power can not be fully restored The FA will then request the BAs to either connect or disconnect their loads depending on how what priority their loads have and how much power has been obtained Table 7 1 Prioritization of buses at a feeder Bus Loadpriority 1 2 2 3 Two different data sets with pre fault load consumption values have been assigned for each scenario Table 7 2 shows the pre fault load consumption values used for fault scenario 1 while table 7 3 shows the data set used for fault scenario 2 These values are considered to be instantaneous and represent the consumption at each load at that par ticular time when the fault occurs 7 2 Fault scenario 1 Single fault The first fault scenario to be considered is a line fault on feeder 1A as illustrated in fig ure A 2 in appendix A Table 7 2 shows the data used for pre fault load consumption at each bus for this scenario 50 Simulation Results Table 7 2 Pre fault load consumption values at each bus for fault scenario 1 2 7 1 Preparing for restoration Switch S1 will disconnect immediately when the loss of the line section 1s detected The disconnection of S1 1s shown in figure A 3 as the square being white instead of black As a result power to all of feeder 1A 1s now lost denoted by a blue line As BAI is monitoring S1 it will record the system change and notify FATA ab
63. erwise it will send a refusal to the initiator If the requested power value exceed its excess capacity it will propose only what 1s possible otherwise it will propose the full amount requested by the initiator 47 MAS Design ContractNetResponder prepareResponse of FeederAgent Measure current power flow on feeder y Calculate excess capacity on feeder no Excess capacity gt 0 yes Send refusal to Y initiator Extract power value requested Requested value gt di excess capacity yes Propose amount Propose available requested by initiator excess capacity Figure 6 14 prepareResponse method of ContractNetReponder Flowcharts for the rest of the behaviors which is part of the FeederAgent class can be seen in Appendix C Besides the flowchart of the BusAgent class can also be found in this appendix 48 MAS Design 49 Simulation Results SIMULATION RESULTS In this chapter the fault scenarios used to test the MAS and the results of the tests will be presented The system has been tested with two fault scenarios One single fault sce nario and one multiple fault scenario Illustrations of the network configuration at dif ferent stages of reconfiguration process can be found in Appendix B for each of the two fault scenarios 7 1 Prioritization scheme The prioritization assigned to each load on a feed
64. es erent ek ed eae uEDRE 54 Table Of Contents S COMUS lOean a a acaceensaeseosnsc secs acaanausaawesenssaneuasawnouseass 59 s FRE ERR T a a resale ened ais 59 EA A e EEE E E E EAE EET E E E E EEEE 59 SPSS DIREN A b 80d EEE RH RTT 60 Relee OSs a a AA a a aN 63 A Fault Scenario Diagraimis e t 65 Fault Scenario 5e eset audere e a a a a ARAN 65 Tnt SC CAIN OD a a a fati m Td NIME Sle 69 B Matlab Simulink ModelsS ssesseescescesscescecsecoecsoecoccooesoeccoccoeccoccoessoesoesseesocssecsoesoee 76 C DIVISI TT 82 D FIPA Communicative ACS iieieee eoe ouo oeove seco eeu eoe va p Seesos ees eo Tes oVan ese eoe cere ides sbossev cus 85 E User Man ulb aeiseieiesceses eco svuc edid oso ve Pe ee ee beoe Eo evo e evev seo a 86 F Java and Matlab Script Source Code 1 ecce ee eee eee eee ee eee eee eee aon 88 Embedded Matlab function Code ccccccccccccecececececccecccececccueeeesaeasucsecessesceceeecseecs 88 Java SOUL CC OOS ise Seis papers narsg tuis baiser u Labeda E ada rele cS 89 LIST OF FIGURES Figure 4 1 System overview of the main elements in JADE Figure 4 2 DF yellow pages service Figure 5 1 Distribution network in normal operation Figure 6 1 The PRS architecture Figure 6 2 Layered agent architectures Figure 6 3 Network diagram with location of agents shown Figure 6 4 The layered structure of the multi agent system and the control and data flow
65. essary see figure 5 1 The BusAgent reports to the FeederAgent in 3l MAS Design case of any abnormal system changes that 1s 1f power is not supplied to its load or if power has been restored It also receives orders from the FeederAgent to connect or disconnect its switches or load The FeederA gent represents a feeder and 1s responsible for initiating power negotia tions with others feeders on behalf of its BusAgents in case of a power outage If the FeederAgent has succeeded in providing power to its BusAgents from another feeder it sends a command to the appropriate BusAgent to connect the two feeders The control flow and information flow between these agents 1s illustrated in figure 6 3 As mentioned BusAgents monitor a number of measurement devices These include power flow measurement devices situated at the loads which continuously measures the power consumed by the loads Abnormal system changes in the network like the loss of voltage would be detected by these measurement devices The BusAgent will then no tify its FeederAgent about these changes If power to the load is lost it will notify the FeederAgent about this event a long with the pre fault power consumption of its load The FeederAgent will then decide on an action to take based on the information passed from several BusAgents These control actions are then passed down to the appropriate BusAgents which will perform the requested action by controlling its switching d
66. etPerformative ACLMessage INFORM reply 111 Content reply sString valucOf power contract priority contract return reply j j Adding ContractNetResponder behaviour MessageTemplate contemplate MessageTemplate and Messagelemplate MatcohProtocol EIPANames InteractionPrortocol FIPA CONTRACT NET MessageTemplate MatchPerformative ACLMessage CFP addBehaviour new ContractNetResponder this contemplate protected ACLMessage prepareResponse ACLMessage cfp throws NotUnderstoodException RefuseException System out printin Agent tgetLocalName CFP received from cfp getSender getName Action is cfp getContent Evaluate the call for proposal float power request extractContent cfp 1 Extracting power value float priority extractContent cfp 2 Extracting power value float capacity power upperlimit current powerlevel 1f capacity gt 0 if power request gt capacity Only propose what s possible System out println Agent getLocalName Proposing capacity ACLMessage propose cfp createReply propose setPerformative ACLMessage PROPOSE propose tillContent propose String valueOr capacity priority return propose j else Propose the requested amount System out println Agent 4getLocalName 4 Proposing power request ACLMessage propose cfp createReply propose setPerformative ACLMessage PROPOSE propose fi1 Conten
67. eturn 1 j catch OntologyException oe oe printStackTrace return 1 Invalid value for power request and priority j catch CodecException ce cGe printStackTrace return 1 Invalid value for power request and priority BusFeederOntology class package Agents import jade content onto import jade content schema public class BusFeederOntology extends Ontology The name identifying this ontology public static final String ONTOLOGY NAME BusFeeder Ontology VOCABULARY public static final String BUSFEEDER BusFeeder public static final String LINESECTION linesection public static final String SECTIONNUMBER sectionnumber public static final String SWITCH switch public static final String SWITCHNUMBER switchnumber public static final String LOAD load public static final String LOADNUMBER loadnumber public static final String VOLTAGELEVEL voltagelevel public static final String POWERLEVEL powerlevel public static final String FAULT fault public static final String FAULTTYPE faulttype public static final String ONLINESECTION onlinesection public static final String CONNECTED connected public static final String CONNNECT connect public static final String DISCONNNECT disconnect public static final String SWITCHIN switchin public static final String SWITCHOUT switchout public static final String NEEDPOWER nee
68. ger cm this getContentManager mnsg set tbhanguage codec getName t msg setOntology ontology getName Switch sw new Switch Load load new Load LineSection linesection new LineSection linesection setSectionStatus false linesection setSectionNumber 1 line section J Notification notification naw Notitication notification setLineSection linesection cm f2llContent msg noLtification T giving list to content manager return msg catch OntologyException oe oe printStackTrace return null catch CodecException ce ce printStackTrace return null ur private float extractContent ACLMessage msg int choose return try ContentManager cm this getContentManager Predicate pre Predicate cm extractContent msg Power power Power pre Notification not Notification pre Switch sw not gqetSwitch boolean switchstatus sw getSwitchStatus Float switchnumber sw getSwitchNumber float switchno switchnumber floatValue LineSection linesection not getLineSection boolean sectionstatus linesection getSectionStatus Integer linesec linesection getSectionNumber int sectionno linesec integerValue Load load not getLoad boolean voltagestatus load getVoltageStatus String prefaultpower load getPower ae Choose returm I i return power request else if choose return 2 return prio else r
69. gquals FA2B command addReceiver BA8 f ewitch TS else if contractor egquals FA2C command addReceiver BA8 switoh Tl else System out printin myAgent getLocalName 4 No match Send out command to the appropriate BusAgent to perform the control action command setProtocol FIPANames InteractizonProtocol FIPA CONTRACT NET Command setcontenti congmect Lie command setConversationlid command myAgent send command Ey step 2 else if subreply getPerformative ACLMessage REFUSE Do nothing if subscription is refused step 2 break Switch end public boolean done return step 2 stay until reply has been received fend Subscribe class private ACLMessage fillContent ACLMessage msg String power value float prio Float priority new Float prio try ContentManager cm this getContentManager msg setLanguage codec getName msg setOntology ontology getName PowerRequest powerreqg new PowerRequest powerreq setPowerValue power value filling value powerreq setPriority priority J filling priority Power power new Power Request req new Request req setPowerRequest powerreq power setPowerRequest powerreq cm fillContent msg power giving list to content manager return msg catch OntologyException oe oe printStackTrace return null catch CodecException ce ce printStac
70. gure A 5 All loads downstream of S1 will now sense the return of voltage and notify FATA Figure 8 2 shows the simulation re sult from the time when the fault is cleared 53 Simulation Results The BAs of feeder 1A will notify FAIA about the return of voltage When FAIA has received notification from all BAs about this event it will conclude that voltage has fully returned to the feeder and therefore register its services with the DF as shown in figure 8 2 Next FAIA will cancel each subscription made during the reconfiguration process in this situation to 1B and 1C FAIA will also request BA4 and BAI to discon nect switch SAB and SAC respectively The network has now returned to its normal configuration CONFIRMED and 125 3 art CONFIRM O and 14 ESAE AGREES 815 140 py and es CONFIRM2 ply 158 INFORMA m INFORMA ett ecelving notif 5 from BAs th rd INF RM 3 13 788 13 pum oni eea d __ umu IM DUEST 1 and pu LL eer ing switching reques Jom A TA ELE UE ancelling subscriptions with FATC and cojrinw2 qi eg sending switching request to BA REQUEST and ee INFORMES cel 859 Figure 7 2 Clearance of fault and subsequent return to normal operation 7 3 Fault Scenario 2 Multiple faults In the second fault scenario the occurrence of two faults in the network is considered First the loss of source 1 occurs
71. having customers pay to get prioritized A prioritization scheme has been incorporated in the restoration strategy for the MAS developed during this project which will be described in chapter 6 In the next chapter the paradigm which forms the basis for multi agent system develop ment will be described 16 3 THE AGENT PARADIGM 3 1 Characteristics of an agent Agent Oriented Programming AOP is a software paradigm which brings together con cepts of artificial intelligence with distributed systems In AOP an application 1s mod eled as a collection of components called agents 1 The computer science community has proposed several different definitions of what exactly an agent 1s According to Wooldridge 7 an agent 1s defined as follows An agent is a computer system that is situated in some environment and that is ca pable of autonomous action in this environment in order to meet its design objec tives Here the environment defines everything external to the agent In a power system the environment would be the physical electric network in which the agent is placed Wooldridge extends this definition of an agent by the following characteristics e Autonomy An agent is autonomous because it operates without direct interven tion from humans or other agents and has control over its actions and internal state This implies that an agent can decide whether or not to perform an action on request from another agent
72. he only to FAs registered FA2A and 2B As seen from the figure it gets refusals from both FAs since they both have already reached their power flow limits FAIC is in the idle state state 1 when it gets the cancellation message from FA2C It requests the appropriate BA in this case BA12 to disconnect the tie switch T9 As it now needs to restore 200 MW of power it goes to state 2 and initiates negotiations with FA2A and FA2B As FA2C it only receives refusals It only has a contract left with FA2B on 90 MW and is forced to prioritize its loads The power values to be restored at its loads are 40 50 100 and a 100 MW for BAI to BA4 respectively see table 7 4 Ac cording to the prioritization of the four loads in table 7 1 it keeps BAI and BA2 con nected while it sends out requests to BA3 and BA4 to disconnect their loads since the power contract left with FA2B is on only 90 MW CANCEL AIC 390 REGUEST 1 FA2C cancelling subscription 119 s with FATC FA1C disconnecting um INFORM AIC 171 Bau tie switch p P oeste eO INF RM B C15 203 15 123 124 ERE LBLkLDLLLLLLLLLLLLLA LA A AAALALLLLLAA A ICI radit FA1C attempting to restore j a REFUSES RIC 234 REFUSES AIC 234 130 131 ops t DIIEST2 rand FAIC prioritizing loads EE E 134 135 mak Ao FA2C attempting to restore attempting to restore b QUEST 2 and 300 MW i e cese p i REFUSE f pep 57 Simulation Results Figure 7 4
73. hierarchical way since such an architecture aligns the most with the structure of the distribution network in chapter 5 Figure 6 3 shows the distribution of agents in the distribution network A BusAgent BA is located at each of the 24 buses A FeederAgent FA is governing each feeder depicted in the figure as FATA FAIB etc In this way the MAS developed in this project resembles the vertical two pass layered architecture the most 30 MAS Design Normal Operation zone FA1A S9 BA9 S10 BA10 S11 BA11 S12 BA12 T1 T2 T9 BA21 S21 BA22 S23 BA23 S24 BA16 BA20 BA24 FA2A S16 FAB S20 FAIC S25 Load Switch connected closed Source2 Load Ii Switch disconnected open Figure 6 3 Network diagram with location of agents shown The BusAgent represents a particular bus and 1s responsible for monitoring one or more loads attached to this bus It can control two switches on either side of it in order to iso late the bus 1f nec
74. his project Agents will need to represent equipment in the microgrid for instance a wind turbine and monitor the state of the equipment while taking decisions based on the dynamic changing conditions in the grid Dimeas et al propose a MAS architecture for a micro grid where the responsibility of the individual agent includes selling or buying power from the grid besides monitoring equipment 16 Multi agent systems might be the most beneficial as a technology when different functionality 1s integrated to create a system which capable of controlling dynamic environments 6l REFERENCES 3 4 5 7 5 9 10 11 12 13 14 Caire G Developing Multi Agent Systems with JADE Wiley amp Sons 2007 Staszesky D et al Feeder Automation is Here IEEE Power and Energy Magazine September October 2005 Riedmiller Reinforcement Learning for Cooperative and Communicating Re active Agents in Electrical Power Grids Nagata T et al A Multi Agent Approach to Distribution System Restoration Electrical Engineering in Japan Vol 152 No 3 2005 Gualdron J A Multi Agent Approach for a Self reconfigurable Electric Power Distribution System MSc Thesis University of Puerto Rico 2006 Lin Z et al Power System Restoration in a Restructured Power Industry Wooldridge M An Introduction to MultiAgent Systems Wiley amp Sons 2002 http www sandc com products intelliteam default asp 2
75. icative acts can be seen in Appendix A 19 The Agent Paradigm 3 3 Ontologies For two agents to communicate about a certain knowledge domain 1 e a certain topic they need to agree on a certain terminology to describe this domain In other words if the domain is a bolt for instance they need a common understanding of what length diameter and thickness of this bolt is For this they use ontologies An ontology is a formal definition of a body of knowledge 7 In the Java Agent DEvelopment framework JADE an ontology can be composed of three type of elements Predicates Concepts and Agent Actions Concepts are structures that consist of things that exist in the world Some examples could be the concepts Person and Car Person name Jens Jensen age 30 height 185 Car manufacturer Audi model TT hp 255 price 800 000 Predicates say something about the relation between concepts A predicate can be either true or false The following predicate indicates that the person Jens 1s the owner of the car specified if predicate Owns is true Owns Person name Jens Jensen age 30 height 185 Car manufacturer Audi model TT hp 255 price 800 000 Agent Actions indicate actions to be performed by agents for instance Buy Car manufacturer Audi model TT hp 255 price 800 000 Person name Jens Jensen age 30 height 185 The agent action Buy could be sent to a certain agent requesting that agent to buy the
76. igger models based on asynchronous generators pre vented further work in that direction It turned out not to be possible to change the set points of the generators while the simulation where running which was required if any agents from JADE should be able to reconfigure the network 79 80 line 4 Bus 1 Line 23 Bus 2 Bus 3 ger o Gg N id E N e z Bus 4 a G ae line 45 Figure B 5 Diagram of 6 bus network 6 Bas xowe r sys tem 30 Hz Bare power 100 MWA Bare voltage 220 KJ il Voltage mai and anes i Malbed Timers i DEplay Coi tut Embeckked Like 12 TERT Mea reme We Teri MATLAB Facto X 0 00o en C 015915 Lite Z3 L 00 C 0 152154 Coin ttl Dom taut sei Lost Tiree Phaze Breaberi i BUSS NENNEN Tiree Phare Breaker diem Lie 25 Saas al L 000 pe C 0106103 A e LL T e Lii 33 L cDOUITT Lie 24 C 0100 L cccoea C 02015 i i i BUE G Lape Phasors Lie 265 L 000111 7 T 010510 powerqui B g8 L 1 Gee Leak a t 7 BUSS Pa Figure B 6 Simulink model of 6 Bus network 8 C FLOWCHARTS SubscriptionResponder Behaviour handleCancel method Extract power agreement from message v Send INFORM done message to subscriber Update current power level Figure C 1 handleCancel method of SubscriptionRes
77. is a proposal and if this is the case it is stored in a list When timeout occurs or all replies has been received it is checked if any proposals has been received If this is the case the next step is to evaluate them otherwise the behavior terminates and the attempt to restore power has been unsuccess ful Evaluation of the proposals Figure 6 11 the flowchart for the part of the behavior where proposals are evaluated According to the selection criteria based on the distance given in table 5 1 the proposer which is closest to the initiator is selected The proposal of this FA is extracted from the message If this proposer can deliver the full amount which the initiator requires the initiator will accept this and send an ACCEPT PROPOSAL message to the proposer Since all power has been obtained the initiator will send an REJECT PROPOSAL mes sage to the rest of the proposals from the list and go to the next step of the negotiation On the other hand if the proposal is less than what is needed given by a variable called power left it will accept the full amount proposed and update the power left variable with this amount The power left variable indicates the difference between the power obtained so far and the power required As long as this variable 1s not zero the initiator will go through the list and find a new proposer If this proposer can provide an amount of power greater or equal to the amount which is needed the initiator will only
78. is project was to simulate the interaction of the multi agent system and a model of a physical distribution network I decided to use Matlab Simulink to build a model of a physical network as I am already familiar with this envi ronment Besides a connection between Matlab and JADE had been reported success fully in 5 However it was not possible to continue the project in this direction due to problems encountered with building the Simulink models This work 1s described in appendix C Since the purpose of this report is to present a prove of concept of the applicability of multi agent systems for distribution service restoration the data used as part of the case study has been chosed to demonstrate the capabilities of the system As my back ground does not lie within power systems the data used for the network case study may not be realistic which may limit the applicability of the results of the project 1 5 Related work The focus of this project relates to the work done by Nagata et al In 4 they propose a multi agent system approach for service restoration The work done in this report ex tends some of the ideas presented in 4 by proposing a prioritization scheme for the restoration strategy Furthermore this report also incorporates the use of FIPA protocols as described in chapter 6 for the interaction between agents in the MAS S amp C Electric Company is providing a feeder automation system called IntelliTeam which 1s based
79. kTrace return null private float extractContent ACLMessage msg int choose return try ContentManager cm this getContentManager Predicate pre Predicate cm extractContent msg Power power Power pre PowerRequest powerrequ power getPowerRequest String powerrequest powerrequ getPowerValue float power request Float parseFloat powerrequest Float flo powerrequ getPriority float prio flo floatValue 1f choose return L1 return power request else if choose return 2 return prio else return 1 j catch OntologyException oe oe printStackTrace return 1 Invalid value for power request and priority j catch CodecException ce ce printStackTrace return 1 Invalid value for power request and priority j j main Agent end BusAgent class package Agents import import import import import import import import import import import import import import import import import import import import import import import import import import import import public jade jade jade jade jade jade jade jade jade jade jade AE ie i pile rhe ubril java java java java jade jade jade jade jade jade jade jade jade jade jade jade jade content content content content content content content content core Al lang lang acC a
80. l 2060 Shared for all behaviours private float power upperlimit 500 MW upper capacity limit for this feeder private Vector FeederSubscribers null Has to be initialized private float current request 0 private int busmsg count 0 private Codec codec new SLCodec private Ontology ontology PowerNegotiationOntology getInstance private long deadline 0 private Vector MySubscribers null Has to be initialized private Vector MySubscriptions null Has to be initialized private float power transfer 0 Shared variable the power transfered to this as a result of a power negotiation private boolean loadokay false Flag to indicate if loads voltage and power levels are okay private int step 0 private int informCnt private String Conversation private String Conversation reqrp id for power request subID id for power request f Load anformation private float localload priority J Priorities of loads Ji snared 0 Count DATA FAIA at this feeder ATD BusAgentl AID BusAgent2 AID BusAgent3 AID BusAgent4 private AID BA1 new private AID BA2 new private AID BA3 new private AID BA4 new private AID FAIA new private AID FAlB new private AID FAIC new private AID FA2A new AID private AID FA2B new private AID FA2C new private AID BAIDs new AID BusAgent2 new AID BusAgent3 new AID BusAgent4 Jy State names
81. ld ensure that devel opers are representing things like transformer and substation the same way Upper Ontology far Power Systems Ontology for specific Ontology for specific Monitoring amp Diagnostic Protection Application Application Ontology for specific Distributed Control Application Madeling amp Simulation Application Figure 8 1 An Upper Ontology extended for different power engineering applications 6 3 Further work This project could be extended by investigating alternative simulation environments which is suitable to use in combination with JADE in order to verify the operation of a MAS Matlab has some limitations for this purpose but PowerFactory might be more suitable Using PowerFactory would enable one to use many existing models of power 60 Conclusion systems These have not been readily available as Simulink models since PowerFactory traditionally is the environment used by power engineers One interesting direction in which this work could be extended is in the application of agent systems for microgrids Microgrids are low voltage networks comprising distrib uted generation sources renewable energy sources like wind solar energy etc and storage devices flywheels batteries etc Although the control concepts of microgrids is different from larger feeder distribution systems the agent systems developed for microgrids will need capabilities similar to the agent system developed in t
82. ment framework FIPA Foundation for Intelligent Physical Agents ACL Agent Communication Language DF Directory Facilitator agent AMS Agent Management System FA Feeder Agent BA Bus Agent 10 1 PREFACE 1 1 Background During the past years the electric power industry has been seen to move towards more decentralized generation changing market operations and more complex distribution systems Due to this development it 1s increasingly difficult to manage the network from a central control system The current centralized SCADA system 1s not longer suf ficient for some control operations 12 In order to face this development there 1s a need for more a distributed control architecture MAS technology provides a solution for creating such distributed control systems The focus of this report 1s the process of service restoration in a power distribution sys tem in particular that 1s the restoration of power in a distribution system in case of an outage The purpose has been to investigate the potential for applying MAS technology to solve this restoration problem The following issues have been addressed in the pro Ject 1 2 Project objectives e What is the potential and challenges for applying multi agent systems in the res toration of distribution systems e What strategy should the individual agents follow to restore the power and how can the responsibilities be divided between the agents to accomplish the task e How c
83. nd one load 78 Voltage Load 1 Figure B 4 Plot of active and reactive power for SourceB and SourceC and voltage at the load Figure C 2 shows voltage plot for the load as well as power plots for source B and source C The voltage for the load 1s shown 1n the top plot while the power for source C is Shown in middle plot and power for source B in the lowest plot The yellow line de notes real power while the purple line denotes reactive power The simulation time has a duration of 0 2 seconds At the time t 0 1 second the power at source B is lost This 1s seen by the yellow line in the bottom plot decreasing towards zero after t 0 1 s At the same time voltage is lost at the load as seen from the top plot At t 0 18 seconds the embedded function block controlling the switch has re ceived data from JADE and the switch is connected source C with the load It 1s seen from the top plot that voltage returns when switch S5 1s connected and the power pro duced by source C also increases After having setup this very simple control of a test circuit in Matlab from JADE I moved on to building a bigger Simulink model of a 6 bus network shown in figure B 5 This network consists of several generators and loads The purpose of connecting this model to a MAS in JADE was the potential of controlling the setpoints of generator blocks in the Simulink model from the agents in JADE However problems encoun tered in Matlab when building b
84. nder wants the receiver to select target agents denoted by a given description and to send an embedded message to them The action of asking another agent whether or not a given proposition is true The action of asking another agent for the object referred to by a referential expression The action of refusing to perform a given action and explaining the reason for the refusal The action of rejecting a proposal to perform some action during a negotiation The sender requests the receiver to perform some action One important class of uses of the request act is to request the receiver to perform another communicative act The sender wants the receiver to perform some action when some given proposition becomes true The sender wants the receiver to perform some action as soon as some proposition becomes true and thereafter each time the proposition becomes true again The act of requesting a persistent intention to notify the sender of the value of a reference and to notify again whenever the object identified by the reference changes Figure D 1 FIPA communicative acts 85 E USER MANUAL This appendix contains a guide on setting up and executing the MAS software in JADE The Java class files and Matlab models and scripts are contained on the CD ROM ac companying this report The multi agent system was developed using Java Development Kit 6 0 Eclipse 3 3 1 1 The Matlab Simulink models were developed using Matlab 7 5 0 Before JA
85. ng the restoration process The Subscribe Protocol has been useful in the agent design in order to keep trach of a FeederAgents power contracts with other FeederA gents An ontology for exchanging information between BusAgents and FeederAgents has been proposed Although being a simple ontology it shows how agents can notify each other about events in their environment in a more structured manner than sending plain text strings Furthermore the potential for simulating a multi agent system behaviour linked to a physical model in Matlab Simulink has been investigated A connection between an agent system in JADE and a Matlab Simulink model has been setup which allows measurement data to be transferred from Simulink and control commands to be sent from JADE to Matlab 8 2 Perspectives MAS technology has attracted a great deal of attention from the power system commu nity since it could solve a number of the challenges faced by the industry today As multi agent systems is based on a distributed architecture where each agent take decisions based of its local information multi agent systems can relieve the computa tional burden of centralized control systems employed in current power systems Be sides as it can offer systems with a flexible and extensible architecture 59 Conclusion Despite the potential of applying MAS technology in the power industry the implemen tation of such system 1n the industry on larger scale has yet to come
86. on A horizontal layer 1s simple but can lead to com plexity as the layers are competing with each other to suggest an action to take A me diator is then needed to decide which layer has the authority to choose an action 7 The vertical layered architecture overcomes the problem about authority since sen sor inputs are passed from the low level layer and up to higher layers which has the au thority to decide on some action On the other hand this design 1s more error prone as information has to pass through every layer causing the system to fail 1f one layer fails Horizontal layered architectures can be distinguished further in one pass or two passed 20 MAS Design architectures In a one pass architecture control flow 1s directed from a measurement layer up to the decision layer which generates an action output itself by the activation of some actuators In a two pass architecture it 1s the same layer which initially take in sensor input and performs the control action decided upon some higher level layer In this way the control flow is going up through all layers at back down again 6 2 System architecture The multi agent system architecture and the division of responsibilities between the in dividual agents has been built on the work published by Nagata et al in 4 In this pa per a distribution system similar to the one used in this project is used as a basis for demonstration of the MAS I have decided to design the MAS in a
87. out the fault event When S1 has disconnected voltage at all loads on feeder 1A is lost and the switches in front of the loads will disconnect too The BAs on the feeder will disconnect switches S2 S3 and S4 to prepare for restoration as shown on figure A 3 As men tioned load consumption is measured continuously so since all BA has lost voltage they will each notify FATA about the event and the pre fault power values at their loads FeederlA is now prepared for restoration This process is common for all feeders so a description of this preparation stage will be left out for fault scenario 2 and 3 51 Simulation Results 2 2 Restoration process When all sectionalizing switches of the feeder are disconnected the feeder has been pre pared for restoration Then FAIA will start in state 1 by receiving notifications from all its BAs which 1s left without power In this scenario all BAs are affected so the total power which has to be restored to feeder 1A 1s 250 MW When notifications from all BAs have been received FAIA starts searching for other FAs Figure 8 1 shows part of the simulation of the restoration process As seen from the figure FAIA will start searching for registered FAs through the DF yellow pages Since feeder 1A is the only feeder having a fault all other FAs are registered It then sends CFP messages out to these FAs requesting 250 MW Since the current power level at feeder 1B and 1C is 280 MW and 290 MW respectively FA
88. ponder Behaviour 82 oubscriptionlnitiatior Behaviour of FeederAgent C Send subscription message to the contractor Any reply within timeout yes lt no yes Add subscription to list Y Update the power transfer variable CD Figure C 2 SubscriptionInitiator Behaviour 83 84 BusAgent CyclicBehaviour start vent message from proxy Command msg eceived from FA yes no Process command Perform switching action no Send DISCONFIRM message to FA v yes yes y Hardware event l Identify fault Notify FA about amount to be restored Send CONFIRM message to FA y Figure C 3 Flowchart for BusAgent Cyclic Behavior D FIPA COMMUNICATIVE ACTS FIPA communicative act Accept Proposal Agree Cancel Call for Proposal Confirm Disconfirm Failure Inform Inform If Inform Ref Not Understood Propagate Propose Proxy Query If Query Ref Refuse Reject Proposal Request Request When Request Whenever Subscribe Description The action of accepting a previously submitted proposal to perform an action The action of agreeing to perform some action possibly in the future The action of one agent informing another ag
89. rable e Distribution systems are typically radial structured During reconfiguration it is usually important to maintain this network structure as much as possible to keep the network configuration as simple as possible Interconnecting different subsystems will create loops and make the configuration more complicated 15 Introduction to Distribution System Restoration Since time is a crucial factor during a service restoration it is desirable to minimize the number of switching operations required to restore power as every switching operation takes time This objective will however be neglected in this project for the sake of sim plicity In addition to dealing with the objective of restoring as many loads as possible dur ing an outage this project will also consider a prioritization of the individual loads Due to the above mentioned constraints it 1s possible that power to the loads in the blackout area can not be fully restored Since it 1s usually not equally important to main tain service for all loads in a distribution network a utility company would attempt to restore power to facilities critical for society first This could for instance be hospitals police stations and governmental agencies etc 15 Secondly the utility would attempt to restore power to businesses and private consumers Industrial businesses would have interest in paying to get prioritized in case of an outage so utilities could benefit com mercially by
90. request content action agent identifier name bob yourdomain com book hotel arrival 15 10 2006 departure 05 07 2002 J 3 Table 3 1 gives an overview of all performatives of the FIPA Agent Communication Language The acts are classified in terms of their usage The CONFIRM act is informa tion passing since it is used to inform the receiving agent that something is true An agent would for instance use the REQUEST performative to ask another agent to per form some action This agent would then reply with a CONFIRM performative if it suc ceeded at performing the action otherwise it would send a message with a DISCON FIRM performative Table 3 1 FIPA Communicative Acts categorized after their usage Communicative mior matioi Requesting Negotiation Action Error Laet OY passing Information 177 performing banding AAE proposal HERE a e dI 1 eme LE LC LL E a cm m A I EL sonim V E LE Blue LL L Ly mom Sid Domit vy LLL DESEE 1L 334 EL dT IH S not ander food oe prpamie opose aey qead E 3 1 5 1 I 3 1 reject proposal lL v L mqust E CIC EC request when request whenever subscribe A full list of the definition of all FIPA commun
91. restoration is the process of detecting the fault isolating the fault and restoring the power to those consumers which have experienced an outage This project deals with the part of the process which concerns restoration of power to the consumers the loads The causes of an outage could be many Transient faults propagating through the network the loss of a power source due to a generator fault or faulty equipment e g the loss of a transmission line Transient faults mainly occur in transmission systems and most of these faults are cleared by protective systems 9 Still some faults turn out to cause a permanent partial or complete blackout of distribution areas The primary objective of service restoration 1s to restore as many unrestored loads as possible until the fault 1s cleared This 1s achieved by closing or opening a number of switches in the network so power can be rerouted or provided by alternative sources if necessary This reconfiguration of the network is subject to several constraints e Transmission lines in a distribution system can only transmit a limited amount of power It might not be possible to recover some loads in the outage area due to such line constraints e There isa constraint on the amount of power which can be provided by alterna tive sources If too many loads are restored the system might get overloaded result ing in a shift in the power balance of the network and a frequency decrease which is undesi
92. rotocol in shown in figure 6 6 36 MAS Design FIPA Subscribe Protocol Initiator Participant subscribe refused agreed and notification necessary inform result inform O n Figure 6 7 Sequence diagram of the FIPA Subscribe Protocol In the MAS developed in this project the protocol is used after an initiator has suc ceeded in finding contractors which can provide power to it The initiator will then sub scribe to get informed by the contractor 1f any changes occur which affect their agree ment This goes both ways The subscribing agent that 1s the agent which initiated the Contract Net Interaction Protocol will cancel the subscription if the fault 1s cleared in the network and power has returned The contractor will likewise cancel the subscrip tion if system changes affect its ability to keep providing the power While the sequence diagram in figure 5 3 shows the interaction when setting up a sub scription figure 5 4 shows the protocol for cancellation It is recommended by FIPA to follow such standards to make interactions less error prone as agents can expect what kind of reply should receive When an agent performs a cancellation it expects to get a reply in form of a INFORM or FAILURE message in order to assure that its message has actually been received by the right agent 37 MAS Design FIPA Cancel Meta Protocol gi cancel canceled communicative act inform done inform not failed failure
93. s The last FA to initiate negotiations 1s FATB requesting 230 MW FA2A and FA2B submit a proposal of their excess capacity which 1s 210 MW and 20 MW respectively This is what is required by FA1B to restore its loads REQUEST O 13 13 Lime 5 ag gum AIC 41 wena d 3 13 i ge eq ee m ee LU ee sending out CFPs PROPOSES AIC 328 i m z ACCEPTPROPOSALS A FAIC accepting proposal from FA2B li and FA2C REJECT PROPOSALO A MC E gom 360 i id bu c m 54 i ueni FA2C sending refusal to FATA f 4 PROPOSEDJMA sre i i REC TUTRN ACCEPTPROPOSALO AIA i T REECTPROPOPALO MMA FA1A accepting proposal from FAZA 81 a oe AC 500 INFORMO ATA s 83 ee a CE i p FATC requesting BAG to connect li swilc REQUEST 2 and_ FAIC requesting BA8 to connect tie switch it nz to FAC Figure 7 3 FAI A and FAIC negotiating with FA2A FA2B and FA2C FAIC sending out CFPs 58 pe ch According to the scenario outlined in the previous chapter a fault on feeder 1C occurs after the loss of source 1 Figure 8 4 shows the result after FA2C has been notified by its BAs that they have lost power When FA2C has received the notifications from its BAs it deregisters from 56 Simulation Results the yellow pages and cancels all its subscriptions in this case only one made with FAIC of 200 MW Afterwards it searches for available FAs and sends out CFP messages to t
94. stem fail Due to the autonomy of each agent it 1s possible to add and remove agents while an agent system is running 13 This is very beneficial when a system has to be upgraded or extended New functionality can be added to a system by installing new agents while the system is online A JADE platform is composed of one or more containers A container 1s the Java proc ess that provides the JADE run time and the services needed for hosting and executing agents 1 An agent is attached to a certain container These containers can be hosted 21 The JADE Platform on the same machine or distributed on a number of machines as would be the case for an implementation of a multi agent system in an electrical distribution network i Container 1 Main Container Container 2 GADT z z GADT cache GADT CT cache PLATFORM Padi Other FIPA een Figure 4 1 System overview of the main elements in JADE Figure 4 1 shows a system composed of three containers each with a number of agents distributed on three machines Every agent system requires a main container A main container differs from normal containers by taking care of the agent lifecycle manage ment It provides each agent with a unique name an Agent Identifier AID at run time and besides that it holds two special agents The AMS Agent Management System and DF Directory Facilitator agents The AMS provides each agent with a unique name an Agent Identifier AID An
95. t propose String valueOr power reguest prliority return propose else Capacity has been reached System out println Agent getLocalName Refuse no capacity throw new RefuseException evaluation failed protected ACLMessage prepareResultNotification ACLMessage cfp ACLMessage propose ACLMessage accept throws FailureException System out printin Agent getLocalName 4 Proposal accepted if true Action is always performed successfully ACLMessage inform accept createReply inform setContent accept getContent Sending power agreement back inform setPerformative ACLMessage INFORM Update current power level float power contract extractContent accept 1 current powerlevel current powerlevel power contract System out println myAgent getLocalName Preparenocity Current powerievel current power level return inform else System out println Agent getLocalName Action execution failed throw new FailureException unexpected error protected void handleRejectProposal ACLMessage cfp ACLMessage propose ACLMessage reject System out println Agent getLocalName Proposal rejected j protected void handleOutOfSequence ACLMessage cfp System out println myAgent getLocalName In handle out of sequence ACLMessage refuse cfp createReply refuse illContent retuse 1 1 3 refuse setPerform
96. te MatchPerformative ACLMessage REQUEST MessageTemplate and MessageTemplate MatchConversationid load command MessageTemplate MatchPerformative ACLMessage REQUEST ACLMessage loadmsg myAgent receive template ACLMessage cmdmsg myAgent receive command ACLMessage loadcmdmsg myAgent receive loadcmd 1f loadmsg null Send notification to FeederAgent that load is down ACLMessage notify new ACLMessage ACLMessage INFORM notify addReceiver new AID FeederAgentlA AID ISLOCALNAME float powervalue Float parseFloat loadmsg getContent if powervalue 0 notLiy setContent Strimg valueOr power Measure 7 forwarding notify setbsncodaing volraocs cow else notrfr setbncodingi voltage up ocLLfwssrcontenbtoto s forwarding notify setoConversationld bus hnotiticdtron myAgent send notify else if cmdmsg null ACLMessage reply cmdmsg createReply reply SsetConversationld command reply switch closed true Breaker is closed Send CONFIRM reply setPerformative ACLMessage CONFIRM myAgent send reply j else if loadcmdmsg null ACLMessage reply loadcmdmsg createReply reply setConversationld load command Send CONFIRM reply setPerformative ACLMessage CONFIRM myAgent send reply else block 3 private ACLMessage fillContent ACLMessage msg String power value float prio try ContentMana
97. tep case 0 Sub Nsg setProLtocol tPIPANanesS IntceractlonPrOLtOOOl FlPA SUBSCRIBE submsg setConversationId subID AID BestProvider confirm getSender float power agree extractContent confirm 1 String poweragree String valueOf power agree submsg fillContent submsg poweragree localload priority Sending the power agreement again submsg setContent confirm getContent Sending the power agreement again submsg addReceiver BestProvider myAgent send submsg System out println myAgent getLocalName sending subscription msg tsubmsg toString step 1 break case 1 Wait for AGREE MessageTemplate mt MessageTemplate MatchProtoco LOEIPANames InterfactronPPoDOOOl bLPA SUBSCRIBE ACLMessage subreply myAgent receive mt if subreply null if subreply getPerformative ACLMessage AGREE System out printin myAgent getLocalName has received AGREE msg if MySubscriptions null Create first time MySubscriptions new Vector MySubscriptions addElement submsg Adding the subscription message 7 ACLMessage command new ACLMessage ACLMessage REQUEST AID contractor subreply getSender if contractor equals FA1A command addReceiver BA8 switcoh SAB else if contractor equals FAIC command addReceiver BA7 switch SAC else if contractor equals FAZ2A command addReceiver BA8 X GWteh T2 else if contractor e
98. tionManager subman null Creates the subscription manager which holds the subscriptions with other agents addBehaviour new SubscriptionResponder this subtemplate subman protected ACLMessage handleSubscription ACLMessage submsg throws NotUnderstoodException RefuseException if FeederSubscribers null FeederSubscribers new Vector j FeederSubscribers addElement submsg System out printin myAgent getLocalName BusSubscribers BusSubscribers ACLMessage agree submsg createReply agree setPerformative ACLMessage AGREE agree setContent submsg getContent return agree protected ACLMessage handleCancel ACLMessage cancel throws FailureException oubscription S GgetSubscription cancel System out printlin myAgent getLocalName in Cancel subscribe section ts Update current powerlevel float power contract extractContent cancel l float priority contract extracrcontenr icancel 2 oystem out printin myAgent getLocalName CANCEL power contract power contract current powerlevel current powerlevel power contract System out printin myAgent getLocalName CANCEL current powerlevel current powerlevel if s null FeederSubscribers removeElement s System out printin myAgent getLocalName s in Cancel section ts s close If when succesful return INFORM msg to sender ACLMessage reply cancel createReply reply s
99. tions listlterator ACLMessage command new ACLMessage ACLMessage REQUEST command setcontent connecr Le while list hasNext ACLMessage submsg ACLMessage list next System out println myAgent getLocalName t submsg toString Iterator con submsg getAllReceiver while con hasNext AID contractor AID con next if contractor equals FAI1B command addReceiver BA4 switch SAB else if contractor equals FAI1C command addReceiver BA1 JA switch SAC else if contractor equals FA2A command addReceiver BA4 switch T2 else if contractor equals FA2B command addReceiver BA4 JJ swsitoen TS else if contractor equals FA2C command addReceiver BA4 J switch TI else System out println myAgent getLocalName No match j j Send out command to the appropriate BusAgent to perform the control action command setConversationId command System out println myAgent getLocalName command toString myAgent send command exitvalue e 1 7 return else exitValue 6 else exitValue 6 public int onEnd return exitValue private class RequestPower extends Behaviour private String powerrequired The best offered price modified amount of power offered private float proposal byBest private float power required private float total proposed 0 private int count 0 privat
100. vailable FeederAgents which it will initiate a negotiation with according to the protocol outline above A FeederAgent will only have its power service registered in the yellow pages if it is able to deliver power to other FeederAgents When a FeederAgent experiences a fault on its feeder and loss of power it will start out dereg istering its power service from the yellow pages The switching between the above is controlled by a round robin non preemptive sched uler of the agent class itself which 1s hidden by the programmer It is often that the above behaviors will wait for receiving a particular message from another agent In order to prevent that one behavior will run all the time until the message it needs has been received one can use a special b ock method The block method blocks that behavior from running until the particular has been received allowing other behaviors to run 6 6 Restoration strategy 6 6 1 The Finite State Machine Behavior A state diagram of the FSM behavior of the FeederAgent class 1s shown in figure 6 8 Besides this diagram a flowchart in figure 6 9 describes the same behavior but in a more detailed manner The following gives a description of the conditions which leads the FeederAgent through the different states The FSM behavior has five states as shown in figure 6 8 State 1 The FeederAgent FA starts in an idle state state 1 waiting for notification messages from any of its BusAgents BAs see figure
101. vel if BAl equals busmsg getSender power is to entire feeder then register Check if this agent is already registered AID PowerGeneratingAgents boolean registered false DFAgentDescription tp new DFAgentDescription try DFAgentDescription result DFService search myAgent tp PowerGeneratingAgents new AID result length for int i 0 i lt result length i if result i getName equals myAgent getName System out println myAgent getName already registered registered true j j j catch FIPAException fe fe printStackTrace j if registered false Registration DFAgentDescription dfd new DFAgentDescription dfd setName getAID ServiceDescription sd new ServiceDescription sd setType PowerGeneration sd setName FeederAgentlA dfd addServices sd try DFService register myAgent dfd System out println myAgent getLocalName is registered catch FIPAException fe fe printStackTrace Cancel any if MySubscriptions null ListIterator list MySubscriptions listIterator while list hasNext ACLMessage submsg ACLMessage list next submsg setPerformative ACLMessage CANCEL submeg setconversationid bowerap cancel myAgent send submsg Send control action to disconnect switch ACLMessage command new ACLMessage ACLMessage REQUEST command seuContCent Gisconnect
102. ware systems A simple distribution network has been used as basis for simulating the operation of the MAS In order to verify the capa bility of the MAS software it has been tested with two kinds of fault scenarios occur ring in the distribution network During the project it has also been considered how to connect a MAS developed in JADE with a model of a physical network The motivation for this has been the poten tial for simulating the interaction between the MAS in JADE and a realistic physical model of a distribution network Matlab Simulink has been used to build a model of a physical network and a communication between Matlab and JADE has been established The results of this project have been a demonstration of a multi agent system as an ap proach to power service restoration The MAS has been seen to perform successfully to different fault scenarios Thus it has been demonstrated how FIPA protocols and on tologies can be utilized in a multi agent system to add intelligence to the service restora tion process TABLE OF CONTENTS PASE ACE 1 doi E a oavaninas e Dev eia eeu SUD I DOC Ex o suede Ta PLU Dee CU everson 4 List OP Ny cesses Sow ccec neces aa a hos ecocawcthtes tee eee ee dearaahiaekt 7 LIS OUT ADIOS arises sedecice TET 9 EISC OF ADDEGVIAUOTS 52 eisitecs sides oserwasiesiectelescitasteaess dauialdelastinadevevsaelectectusieesess 10 P duorum M E E 11 KUBIK OUI Gl t
103. ween Matlab and JADE The printout of the Simulink model of this network 1s shown in figure B 3 Embedded matlab function blocks are highlighted with colours The blue blocks are the embedded function blocks measuring the voltage at source C and B and sending these values to JADE The purple block measures the power flow at the load and sends this data to the LoadAgent in JADE A timer cuts off power to voltage source B at time t 0 1 The loss of voltage is measured by source B embedded function block which disconnects switch S3 Power to the load is now cut off When the LoadAgent in JADE receives power values approach ing Zero it starts requesting SourceAgentC to restore its nominal power SourceAgent C accepts this and sends a command to the BreakerAgent which in turn pass a value to the breaker embedded function block shown in green to connect the switch S5 Power has now been restored to the load by source C 11 V E Gain3 Voltage 3 SourceAqgentC Fort 1003 Sc DNE a _o Circuit Pi Section Line C t4 Switch 54 E uen EET Breaker amp gentss Source C Switch amp 5 1 To SaurceAgentB Voltage Measurement Equivalent Active amp Reactive Circuit Fi Section Line Switch 53 Power Subsystem Current Weasurementd Current We asure ment Initialized Controlled Voltage eB LaadAgentz Port 2000 Eke 110 Mwar 1207 BOHz i gt RAN Figure B 3 Simulink model of network with two sources a

Download Pdf Manuals

image

Related Search

Related Contents

  AVerMedia AVerTV PLUG & WATCH  MiG-15bis„FAGOT“  Bryant 463AAC010BA Air Conditioner User Manual  Instructions for use  (平成23年4月1日)(PDF形式, 607.40KB)  Chargers/Boosters    ギガビット対応PoEスイッチングハブ取扱説明書    

Copyright © All rights reserved.
Failed to retrieve file