Giter Site home page Giter Site logo

epanetcpa's People

Contributors

rtaormina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

epanetcpa's Issues

Few small issues using the toolbox

Hi @rtaormina,
I would like to thank you for sharing the epanetCPA toolbox, herein some small issues I encountered in the initial setup:

  1. If an attacked component (in the network) is not listed in 'what_to_store' (under [CYBEROPTIONS] tag), the simulation then stops and issue an error - suggesting to add a catch and try blocks in presimulation checks to alert the user.

  2. If component ID name in the .inp file have an underscore ('_'), the toolbox then split the name (e.g., Tank_1 will become Tank), what can issue errors - suggesting while creating the .inpx file, to replace all names to valid names or to considered replacing the split name function to a more tolerated operation or to alert the user.

  3. If water tank in the .inp file is linked to more then one pipe, the toolbox will create dummy tanks per pipe link in the .inpx file - resulting duplicated tank's ID names and issue and error - suggesting to add instructions to the toolbox guide how to avoid this case.

  4. If a component is used in the cyber-layer and the component's ID name in the .inp file identify only by numbers (e.g., Pump '335'), the toolbox issue an error - suggesting to add instructions to the toolbox guide how to avoid this case.

  5. Attack on actuators (please see my impervious issue on the subject)

That all for now,
Thank you again and I hope this information will be useful.

Generated .inpx File Cannot Be Used

While attempting to create a customized model for attack simulation, I've imported a BaseModel.inp file to use in tailoring attacks to a very simple network. However, attempting to run any scenario against the input model results in the following error messages from the Matlab Command Window:
`
Error using EpanetHelper.epanetloadfile (line 112)
Could not open network 'C:\Users\user\Documents\Research\EPANet\epanetCPA\BaseModel.inpx'.
Returned empty array.

Error in EpanetCPAMap/initializeMap (line 189)
EpanetHelper.epanetloadfile(self.modifiedFilePath);

Error in EpanetCPAMap (line 54)
self = self.initializeMap();

Error in EpanetCPA (line 61)
theMap = EpanetCPAMap(inpFile, self.cybernodes, self.cyberlinks, self.cyberoptions,
PDA_ENABLED);

Error in main_baseModel (line 19)
simul = EpanetCPA(inpFilePath, [scenarioFolder, noAttackCpaFile]); %
`

I've compared and rewritten my model in order to match the format of your example minitown_map.inp and ctown_map.inp as closely as possible, and am even able to open and study the generated BaseModel.inpx file in EPANet2.0. However, this above error is returned every time, and the error code returned (Input Error 200) by the ENopen function simply provides the feedback "Input Error 200: one or more errors in input file". Clearly the error is not one significant enough to prevent the file from being opened and run in EPANet2.0, but it is nevertheless preventing the attack simulation from running. I have performed no modifications to the naturally generated .inpx file, and so am left stumped as to how to fix this and proceed.

User Basic Configurations:
Windows 10 (64bit)
Matlab R2020a (most recent update)
EPANet 2.0 (with dev toolkit 2.2)

If more information is needed to assist in determining whether the issue lies in my own system or in the epanetCPA file generation, I am happy to provide whatever I can.
Please find both BaseModel.inp and BaseModel.inpx attached for review and testing.

BaseModel.zip

Attack on Actuator

Hi @rtaormina!
When I'm attacking a valve to inject false settings,
as the example:

[CYBERATTACKS]
; Type,	 Target,	Init_cond,     End_cond,	    Arguments
 Actuator,  FCV1,     TIME==20,   TIME==30,      85

The settings changes during the attack, but at the end of the attack the original settings do not restored.
From my experience the settings after the attack are replaced with the value of zero, what can cause a big mess in the WDN.

Do I doing it wrong or it is a bug?
Anyway, for now this is my solution:

; FCV1 - original setting 90.3 
 Actuator, FCV1,    TIME==20,     TIME==30,     85
 Actuator, FCV1,    TIME==30,     TIME==-1,     90.3

Thanks!

Error will using the toolbox on a new network layout

Thank you very much for the comprehensive toolbox,

I try the two examples and it seems that they are working fine,
I'm having a trouble to run the simulation on different network (without attacks at this point)

  • in Net3.zip are the .inp layout and the .cpa files

I'm trying to run the following code (inside the toolbox folder):


% add path for epanetCPA toolbox
addpath('.\epanetCPA\')

% add location of the map and cpa files  
inpFilePath = 'Net3_epanetjs.inp';

% Define scenario
scenarioFolder = './scenarios/Net3_epanepjs/';
noAttackCpaFile = 'Net3_epanetjs_no_attacks.cpa';

% Similation without attacks (used for comparison).
simul = EpanetCPA(inpFilePath, [scenarioFolder, noAttackCpaFile]); % 
simul = simul.run();
simul.outputResults('Net3_no_attacks');

I wonder if you can help me understand the following error:

Warning: The data type 'FcnPtr' used by function ENepanet does not exist. 
Warning: The data type 'FcnPtr' used by function ENepanet does not exist. 
TANKS
OF_TANKS
JUNCTIONS
OF_JUNCTIONS
PUMPS
VALVES
PIPES
OF_PIPES
RESERVOIRS
Warning: SCADA cybernode not found. Adding SCADA node 
PLC and controls are consistent. Check PASSED!
Warning: The data type 'FcnPtr' used by function ENepanet does not exist. 
Error using EpanetControl/overrideControl (line 130)
Failed creating variable from dictionary.

Error in EpanetCPASimulation/overrideControls (line 606)
            controls(ix).overrideControl(PLCdict);

Error in EpanetCPASimulation/hydraulicStep (line 411)
            self.overrideControls(thisController, PLCdict);

Error in EpanetCPASimulation/run (line 223)
            [self,tstep] = self.hydraulicStep(tstep);             

Error in EpanetCPA/run (line 75)
        self.simulation = self.simulation.run();

Error in main (line 68)
simul = simul.run();

Warning: The data type 'FcnPtr' used by function ENepanet does not exist. 

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.