Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MES_Wind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debolskiy Andrey
MES_Wind
Commits
a3abd430
Commit
a3abd430
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
tmp
parent
eee6c0ec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MES_Wind.suo
+0
-0
0 additions, 0 deletions
MES_Wind.suo
MES_Wind/frmMain.cs
+9
-9
9 additions, 9 deletions
MES_Wind/frmMain.cs
PRMLibrary/PRMLibrary.cs
+37
-29
37 additions, 29 deletions
PRMLibrary/PRMLibrary.cs
with
46 additions
and
38 deletions
MES_Wind.suo
deleted
100644 → 0
+
0
−
0
View file @
eee6c0ec
File deleted
This diff is collapsed.
Click to expand it.
MES_Wind/frmMain.cs
+
9
−
9
View file @
a3abd430
...
...
@@ -268,17 +268,17 @@ namespace MES_Wind
}
//Create a PRM_wind class and add all the properties from above
PRMLibrary
.
Module
prmwind
=
new
PRMLibrary
.
Module
();
prmwind
.
powerLines
=
powerlinesToPRM
;
prmwind
.
powerStations
=
powerpointsToPRM
;
prmwind
.
prognosticCells
=
prog_wind
;
prmwind
.
prognosticCellSize
=
prog_cell
;
prmwind
.
prognosticAffineCoefficients
=
prog_aff
;
prmwind
.
climateCells
=
clim_wind
;
prmwind
.
climateCellSize
=
clim_cell
;
prmwind
.
climateAffineCoefficients
=
clim_aff
;
prmwind
.
input
.
powerLines
=
powerlinesToPRM
;
prmwind
.
input
.
powerStations
=
powerpointsToPRM
;
prmwind
.
input
.
prognosticCells
=
prog_wind
;
prmwind
.
input
.
prognosticCellSize
=
prog_cell
;
prmwind
.
input
.
prognosticAffineCoefficients
=
prog_aff
;
prmwind
.
input
.
climateCells
=
clim_wind
;
prmwind
.
input
.
climateCellSize
=
clim_cell
;
prmwind
.
input
.
climateAffineCoefficients
=
clim_aff
;
//Calculate which lines are broken
List
<
PRMLibrary
.
Powerline
>
prmBrokenLines
=
prmwind
.
brokenPowerLinesAfterCheck
();
prmwind
.
c
heckPower
();
prmwind
.
C
heckPower
();
// new FeatureSet for resulting broken powerlines
//IFeatureSet brklineSet = new FeatureSet(FeatureType.Line);
//DataTable dt = pwlineSet.DataTable;
...
...
This diff is collapsed.
Click to expand it.
PRMLibrary/PRMLibrary.cs
+
37
−
29
View file @
a3abd430
...
...
@@ -125,7 +125,7 @@ namespace PRMLibrary
FunctionClimate15
=
4
}
public
class
Module
public
class
InputDTO
{
//prognistic raster info
public
List
<
List
<
PrognosticCell
>>
prognosticCells
;
...
...
@@ -141,35 +141,44 @@ namespace PRMLibrary
public
List
<
Powerline
>
powerLines
;
//station collection
public
List
<
PowerStation
>
powerStations
;
public
double
dist_threshold
=
500
;
}
public
class
OutputDTO
{
//broken stations and lines
public
List
<
PowerStation
>
disabledStations
=
new
List
<
PowerStation
>();
public
List
<
Powerline
>
disabledLines
=
new
List
<
Powerline
>();
public
double
dist_threshold
=
500
;
}
public
class
Module
{
public
InputDTO
input
;
public
OutputDTO
output
;
//Main function for power graph algorithm
public
void
c
heckPower
()
public
void
C
heckPower
()
{
//get the graph
PreparingPowerItems
();
//start from source points
foreach
(
PowerStation
pwstation
in
powerStations
)
foreach
(
PowerStation
pwstation
in
input
.
powerStations
)
{
if
(
pwstation
.
issource
)
{
CheckPowerPointsForStation
(
pwstation
);
}
}
foreach
(
Powerline
line
in
powerLines
)
foreach
(
Powerline
line
in
input
.
powerLines
)
{
if
(
line
.
isbroken
)
{
disabledLines
.
Add
(
line
);
output
.
disabledLines
.
Add
(
line
);
}
}
foreach
(
PowerStation
powerStation
in
powerStations
)
foreach
(
PowerStation
powerStation
in
input
.
powerStations
)
{
if
(!
powerStation
.
ison
&&
!(
powerStation
.
type
.
ToUpperInvariant
().
Trim
()
==
"POLE"
)){
disabledStations
.
Add
(
powerStation
);
output
.
disabledStations
.
Add
(
powerStation
);
}
}
return
;
...
...
@@ -180,7 +189,6 @@ namespace PRMLibrary
if
(!
sourcepoint
.
ison
)
{
throw
new
Exception
(
"CheckPowerPointsForStation is called from disabled sourcepoint"
);
return
;
}
// if the point is not a pole - i.e. we know
// it can redistribute power within connected lines
...
...
@@ -190,7 +198,7 @@ namespace PRMLibrary
if
(!
line
.
isbroken
&&
!
line
.
ison
)
{
line
.
ison
=
true
;
foreach
(
PowerStation
powerStation
in
powerStations
)
foreach
(
PowerStation
powerStation
in
input
.
powerStations
)
{
if
(
powerStation
.
identifier
!=
sourcepoint
.
identifier
&&
(
powerStation
.
identifier
==
line
.
pointFromID
||
powerStation
.
identifier
==
line
.
pointToID
))
{
...
...
@@ -226,7 +234,7 @@ namespace PRMLibrary
{
//First we make sure that all the sources are ON
//and all non sources are OFF
foreach
(
PowerStation
powerStation
in
powerStations
)
foreach
(
PowerStation
powerStation
in
input
.
powerStations
)
{
if
(
powerStation
.
issource
==
true
)
{
powerStation
.
ison
=
true
;
...
...
@@ -237,7 +245,7 @@ namespace PRMLibrary
// for each power station we create a list of powerlines it is attached to
List
<
Powerline
>
lines
=
new
List
<
Powerline
>();
foreach
(
Powerline
line
in
powerLines
)
foreach
(
Powerline
line
in
input
.
powerLines
)
{
//we also switch OFF all lines
line
.
ison
=
false
;
...
...
@@ -252,7 +260,7 @@ namespace PRMLibrary
{
List
<
Powerline
>
brklines
=
new
List
<
Powerline
>();
// actually there are curves in powerLines
foreach
(
Powerline
powerCurve
in
powerLines
)
foreach
(
Powerline
powerCurve
in
input
.
powerLines
)
{
// get coordinates list
List
<
Coordinate
>
points
=
powerCurve
.
coords
;
...
...
@@ -287,7 +295,7 @@ namespace PRMLibrary
private
bool
linearLineIsBroken
(
Coordinate
coord1
,
Coordinate
coord2
,
double
heightLine
,
int
power
)
{
double
distance
=
Math
.
Sqrt
((
coord2
.
X
-
coord1
.
X
)
*
(
coord2
.
X
-
coord1
.
X
)
+
(
coord2
.
Y
-
coord1
.
Y
)
*
(
coord2
.
Y
-
coord1
.
Y
));
double
distpropD
=
distance
/
dist_threshold
;
double
distpropD
=
distance
/
input
.
dist_threshold
;
List
<
Coordinate
>
pointlist
=
new
List
<
Coordinate
>();
Coordinate
midpoint
=
new
Coordinate
();
int
distpropI
=
Convert
.
ToInt32
(
distpropD
);
...
...
@@ -388,13 +396,13 @@ namespace PRMLibrary
case
FunctionType
.
FunctionVelocityX
:
case
FunctionType
.
FunctionVelocityY
:
{
return
prognosticAffineCoefficients
;
return
input
.
prognosticAffineCoefficients
;
}
case
FunctionType
.
FunctionClimate5
:
case
FunctionType
.
FunctionClimate10
:
case
FunctionType
.
FunctionClimate15
:
{
return
climateAffineCoefficients
;
return
input
.
climateAffineCoefficients
;
}
default
:
break
;
...
...
@@ -445,13 +453,13 @@ namespace PRMLibrary
case
FunctionType
.
FunctionVelocityX
:
case
FunctionType
.
FunctionVelocityY
:
{
return
prognosticCells
[
index
.
Row
][
index
.
Col
].
coords
;
return
input
.
prognosticCells
[
index
.
Row
][
index
.
Col
].
coords
;
}
case
FunctionType
.
FunctionClimate5
:
case
FunctionType
.
FunctionClimate10
:
case
FunctionType
.
FunctionClimate15
:
{
return
climateCells
[
index
.
Row
][
index
.
Col
].
coords
;
return
input
.
climateCells
[
index
.
Row
][
index
.
Col
].
coords
;
}
default
:
break
;
...
...
@@ -466,13 +474,13 @@ namespace PRMLibrary
case
FunctionType
.
FunctionVelocityX
:
case
FunctionType
.
FunctionVelocityY
:
{
return
forRows
?
prognosticCells
.
Count
:
prognosticCells
[
0
].
Count
;
return
forRows
?
input
.
prognosticCells
.
Count
:
input
.
prognosticCells
[
0
].
Count
;
}
case
FunctionType
.
FunctionClimate5
:
case
FunctionType
.
FunctionClimate10
:
case
FunctionType
.
FunctionClimate15
:
{
return
forRows
?
climateCells
.
Count
:
climateCells
[
0
].
Count
;
return
forRows
?
input
.
climateCells
.
Count
:
input
.
climateCells
[
0
].
Count
;
}
default
:
break
;
...
...
@@ -486,23 +494,23 @@ namespace PRMLibrary
{
case
FunctionType
.
FunctionVelocityX
:
{
return
prognosticCells
[
index
.
Row
][
index
.
Col
].
velocityX
;
return
input
.
prognosticCells
[
index
.
Row
][
index
.
Col
].
velocityX
;
}
case
FunctionType
.
FunctionVelocityY
:
{
return
prognosticCells
[
index
.
Row
][
index
.
Col
].
velocityY
;
return
input
.
prognosticCells
[
index
.
Row
][
index
.
Col
].
velocityY
;
}
case
FunctionType
.
FunctionClimate5
:
{
return
climateCells
[
index
.
Row
][
index
.
Col
].
wind5
;
return
input
.
climateCells
[
index
.
Row
][
index
.
Col
].
wind5
;
}
case
FunctionType
.
FunctionClimate10
:
{
return
climateCells
[
index
.
Row
][
index
.
Col
].
wind10
;
return
input
.
climateCells
[
index
.
Row
][
index
.
Col
].
wind10
;
}
case
FunctionType
.
FunctionClimate15
:
{
return
climateCells
[
index
.
Row
][
index
.
Col
].
wind15
;
return
input
.
climateCells
[
index
.
Row
][
index
.
Col
].
wind15
;
}
default
:
break
;
...
...
@@ -517,13 +525,13 @@ namespace PRMLibrary
case
FunctionType
.
FunctionVelocityX
:
case
FunctionType
.
FunctionVelocityY
:
{
return
prognosticCellSize
;
return
input
.
prognosticCellSize
;
}
case
FunctionType
.
FunctionClimate5
:
case
FunctionType
.
FunctionClimate10
:
case
FunctionType
.
FunctionClimate15
:
{
return
climateCellSize
;
return
input
.
climateCellSize
;
}
default
:
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment