psr-factory 4.1.0b4__py3-none-win_amd64.whl → 4.1.0b9__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
psr/factory/factory.pmk CHANGED
@@ -6659,12 +6659,11 @@ PrefDateMonth INTEGER,11 AUTOSET(model.parm("PrefDateMonth"))
6659
6659
  PrefDateYear INTEGER,12 AUTOSET(model.parm("PrefDateYear"))
6660
6660
  Score REAL,13 AUTOSET(model.parm("Score"))
6661
6661
  Fix INTEGER,14 AUTOSET(model.parm("Fix"))
6662
- FixOuter INTEGER,15 AUTOSET(model.parm("FixOuter"))
6663
- Plant REFERENCE,16 AUTOSET(model.parm("Plant"))
6662
+ Plant REFERENCE,15 AUTOSET(model.parm("Plant"))
6664
6663
  END_DATA
6665
6664
  DEFINE_HEADER
6666
6665
  $version=3
6667
- !Name,UnitCode,MinDateDay,MinDateMonth,MinDateYear,MaxDateDay,MaxDateMonth,MaxDateYear,Duration,PrefDateDay,PrefDateMonth,PrefDateYear,Score,Fix,FixOuter,Plant
6666
+ !Name,UnitCode,MinDateDay,MinDateMonth,MinDateYear,MaxDateDay,MaxDateMonth,MaxDateYear,Duration,PrefDateDay,PrefDateMonth,PrefDateYear,Score,Fix,Plant
6668
6667
  END_HEADER
6669
6668
  END_MASK
6670
6669
  //--------------------------------------------------------------------------------------------------
@@ -6866,6 +6865,7 @@ CONTEXT_READ optmain
6866
6865
  CONTEXT_WRITE optmain
6867
6866
  CLASSNAME PSRPlant
6868
6867
  MODEL StageCstr
6868
+ MERGE_OBJECTS TRUE
6869
6869
  END_AUTOMATIC_INFO
6870
6870
 
6871
6871
  DEFINE_DATA
@@ -6889,6 +6889,7 @@ CONTEXT_READ optmain
6889
6889
  CONTEXT_WRITE optmain
6890
6890
  CLASSNAME PSRSystem
6891
6891
  MODEL MinRes
6892
+ MERGE_OBJECTS TRUE
6892
6893
  END_AUTOMATIC_INFO
6893
6894
 
6894
6895
  DEFINE_DATA
@@ -6913,15 +6914,17 @@ CONTEXT_READ optmain
6913
6914
  CONTEXT_WRITE optmain
6914
6915
  CLASSNAME PSRSystem
6915
6916
  MODEL InstDem
6917
+ MERGE_OBJECTS TRUE
6916
6918
  END_AUTOMATIC_INFO
6917
6919
 
6918
6920
  DEFINE_DATA
6919
- PSRSystem REFERENCE,1
6920
- InstantDemand REAL,2
6921
+ PSRSystem REFERENCE,1
6922
+ InstantDemandDate DATE,2 YYYY/MM/DD AUTOSET
6923
+ InstantDemand REAL,3 AUTOSET
6921
6924
  END_DATA
6922
6925
  DEFINE_HEADER
6923
6926
  $version=2
6924
- !PSRSystem,InstantDemand
6927
+ !PSRSystem,InstantDemandDate,InstantDemand
6925
6928
  END_HEADER
6926
6929
  END_MASK
6927
6930
  //--------------------------------------------------------------------------------------------------
@@ -6984,6 +6987,7 @@ CONTEXT_READ optmain
6984
6987
  CONTEXT_WRITE optmain
6985
6988
  CLASSNAME PSRPlant
6986
6989
  MODEL UnitFactors
6990
+ MERGE_OBJECTS TRUE
6987
6991
  END_AUTOMATIC_INFO
6988
6992
 
6989
6993
  DEFINE_DATA
@@ -7007,6 +7011,7 @@ CONTEXT_READ optmain
7007
7011
  CONTEXT_WRITE optmain
7008
7012
  CLASSNAME PSRPlant
7009
7013
  MODEL UnitCodes
7014
+ MERGE_OBJECTS TRUE
7010
7015
  END_AUTOMATIC_INFO
7011
7016
 
7012
7017
  DEFINE_DATA
@@ -8558,6 +8563,22 @@ Kv REAL 22,27 AUTOSET(model.parm("Kv"))
8558
8563
  END_DATA
8559
8564
  END_MASK
8560
8565
 
8566
+ //---------------------------------------------------------------------
8567
+ // AREA V17
8568
+ //---------------------------------------------------------------------
8569
+ DEFINE_MASK ROWDATA SDDP_V17_area
8570
+
8571
+ DEFINE_HEADER
8572
+ $version=1
8573
+ ! Num ....Nome.)
8574
+ END_HEADER
8575
+ DEFINE_DATA
8576
+ Num INTEGER 1,5
8577
+ Nome STRING 7,18
8578
+ END_DATA
8579
+
8580
+ END_MASK
8581
+
8561
8582
  //---------------------------------------------------------------------
8562
8583
  //---------------------------------------------------------------------
8563
8584
  DEFINE_MASK ROWDATA SDDP_v10.2_Dcirc
@@ -14700,13 +14721,12 @@ CREATE_OBJECTS TRUE
14700
14721
  END_AUTOMATIC_INFO
14701
14722
 
14702
14723
  DEFINE_DATA
14703
- name REFERENCE,1 AUTOSET(model.parm("name"))
14704
- Serie REFERENCE,2 AUTOSET(model.parm("Serie"))
14705
- MonitoringList REFERENCE,3 AUTOSET(model.parm("MonitoringList"))
14724
+ Serie REFERENCE,1 AUTOSET(model.parm("Serie"))
14725
+ MonitoringList REFERENCE,2 AUTOSET(model.parm("MonitoringList"))
14706
14726
  END_DATA
14707
14727
  DEFINE_HEADER
14708
14728
  $version=1
14709
- !name,Serie,MonitoringList
14729
+ !Serie,MonitoringList
14710
14730
  END_HEADER
14711
14731
  END_MASK
14712
14732
  //--------------------------------------------------------------------------------------------------
@@ -14978,9 +14998,9 @@ DEFINE_HEADER
14978
14998
  END_HEADER
14979
14999
 
14980
15000
  DEFINE_DATA
14981
- Code INTEGER,1
14982
- Name STRING,2
14983
- UseUserScenarios INTEGER,3
15001
+ Code INTEGER,1
15002
+ Name STRING,2
15003
+ UseUserScenarios INTEGER,3 AUTOSET(model.parm("UseUserScenarios"))
14984
15004
  END_DATA
14985
15005
 
14986
15006
  END_MASK
@@ -14994,7 +15014,7 @@ DEFINE_HEADER
14994
15014
  END_HEADER
14995
15015
 
14996
15016
  DEFINE_DATA
14997
- Circuit INTEGER,1
15017
+ Circuit INTEGER,1
14998
15018
  DLR INTEGER,2
14999
15019
  END_DATA
15000
15020
 
@@ -15049,13 +15069,12 @@ DEFINE_MASK CSVDATA SDDP_dzone
15049
15069
 
15050
15070
  DEFINE_HEADER
15051
15071
  $version=1
15052
- !Code,Name,SystemCode
15072
+ !Code,Name
15053
15073
  END_HEADER
15054
15074
 
15055
15075
  DEFINE_DATA
15056
15076
  Code INTEGER 1
15057
15077
  Name STRING 2
15058
- SystemCode INTEGER 3
15059
15078
  END_DATA
15060
15079
 
15061
15080
  END_MASK
@@ -15614,7 +15633,7 @@ DEFINE_MASK CSVDATA SDDP_ddclink
15614
15633
 
15615
15634
  DEFINE_HEADER
15616
15635
  $version=1
15617
- !Code,Name,BusFrom,BusTo,Existing,Status,Decommissioned,CapacityFromTo,CapacityToFrom,LossFactorFromTo,LossFactorToFrom,CapacityEmergencyFromTo,CapacityEmergencyToFrom,FlagQuadraticLoss,R,MeteringEnd,ReactivePowerFactorFrom,ReactivePowerFactorTo,WheelingCostFromTo,WheelingCostToFrom,Currency,ReserveMargin
15636
+ !Code,Name,BusFrom,BusTo,Existing,Decommissioned,CapacityFromTo,CapacityToFrom,LossFactorFromTo,LossFactorToFrom,CapacityEmergencyFromTo,CapacityEmergencyToFrom,FlagQuadraticLoss,R,MeteringEnd,ReactivePowerFactorFrom,ReactivePowerFactorTo,WheelingCostFromTo,WheelingCostToFrom,Currency,ReserveMargin
15618
15637
  END_HEADER
15619
15638
 
15620
15639
  DEFINE_DATA
@@ -15623,23 +15642,22 @@ Name STRING 2
15623
15642
  BusFromCode INTEGER 3
15624
15643
  BusToCode INTEGER 4
15625
15644
  Existing INTEGER 5 AUTOSET
15626
- Status INTEGER 6 AUTOSET
15627
- Decommissioned INTEGER 7 AUTOSET
15628
- CapacityFromTo REAL 8 AUTOSET
15629
- CapacityToFrom REAL 9 AUTOSET
15630
- LossFactorFromTo REAL 10 AUTOSET
15631
- LossFactorToFrom REAL 11 AUTOSET
15632
- CapacityEmergencyFromTo REAL 12 AUTOSET
15633
- CapacityEmergencyToFrom REAL 13 AUTOSET
15634
- FlagQuadraticLoss INTEGER 14 AUTOSET(model.parm("FlagQuadraticLoss"))
15635
- R REAL 15 AUTOSET
15636
- MeteringEnd INTEGER 16 AUTOSET(model.parm("MeteringEnd"))
15637
- ReactivePowerFactorFrom REAL 17 AUTOSET
15638
- ReactivePowerFactorTo REAL 18 AUTOSET
15639
- WheelingCostFromTo REAL 19 AUTOSET(model.parm("WheelingCostFromTo"))
15640
- WheelingCostToFrom REAL 20 AUTOSET(model.parm("WheelingCostToFrom"))
15641
- Currency STRING 21 AUTOSET(model.parm("Currency"))
15642
- ReserveMargin REAL 22 AUTOSET(model.parm("ReserveMargin"))
15645
+ Decommissioned INTEGER 6 AUTOSET
15646
+ CapacityFromTo REAL 7 AUTOSET
15647
+ CapacityToFrom REAL 8 AUTOSET
15648
+ LossFactorFromTo REAL 9 AUTOSET
15649
+ LossFactorToFrom REAL 10 AUTOSET
15650
+ CapacityEmergencyFromTo REAL 11 AUTOSET
15651
+ CapacityEmergencyToFrom REAL 12 AUTOSET
15652
+ FlagQuadraticLoss INTEGER 13 AUTOSET(model.parm("FlagQuadraticLoss"))
15653
+ R REAL 14 AUTOSET
15654
+ MeteringEnd INTEGER 15 AUTOSET(model.parm("MeteringEnd"))
15655
+ ReactivePowerFactorFrom REAL 16 AUTOSET
15656
+ ReactivePowerFactorTo REAL 17 AUTOSET
15657
+ WheelingCostFromTo REAL 18 AUTOSET(model.parm("WheelingCostFromTo"))
15658
+ WheelingCostToFrom REAL 19 AUTOSET(model.parm("WheelingCostToFrom"))
15659
+ Currency STRING 20 AUTOSET(model.parm("Currency"))
15660
+ ReserveMargin REAL 21 AUTOSET(model.parm("ReserveMargin"))
15643
15661
 
15644
15662
  END_DATA
15645
15663
 
@@ -15649,7 +15667,7 @@ DEFINE_MASK CSVDATA SDDP_mdclink
15649
15667
 
15650
15668
  DEFINE_HEADER
15651
15669
  $version=1
15652
- !Day,Month,Year,Code,Name,BusFrom,BusTo,Existing,Status,Decommissioned,CapacityFromTo,CapacityToFrom,LossFactorFromTo,LossFactorToFrom,CapacityEmergencyFromTo,CapacityEmergencyToFrom,R,ReactivePowerFactorFrom,ReactivePowerFactorTo
15670
+ !Day,Month,Year,Code,Name,BusFrom,BusTo,Existing,Decommissioned,CapacityFromTo,CapacityToFrom,LossFactorFromTo,LossFactorToFrom,CapacityEmergencyFromTo,CapacityEmergencyToFrom,R,ReactivePowerFactorFrom,ReactivePowerFactorTo
15653
15671
  END_HEADER
15654
15672
 
15655
15673
  DEFINE_DATA
@@ -15661,20 +15679,40 @@ Name STRING 5
15661
15679
  BusFromCode INTEGER 6
15662
15680
  BusToCode INTEGER 7
15663
15681
  Existing INTEGER 8 AUTOSET
15664
- Status INTEGER 9 AUTOSET
15665
- Decommissioned INTEGER 10 AUTOSET
15666
- CapacityFromTo REAL 11 AUTOSET
15667
- CapacityToFrom REAL 12 AUTOSET
15668
- LossFactorFromTo REAL 13 AUTOSET
15669
- LossFactorToFrom REAL 14 AUTOSET
15670
- CapacityEmergencyFromTo REAL 15 AUTOSET
15671
- CapacityEmergencyToFrom REAL 16 AUTOSET
15672
- R REAL 17 AUTOSET
15673
- ReactivePowerFactorFrom REAL 18 AUTOSET
15674
- ReactivePowerFactorTo REAL 19 AUTOSET
15682
+ Decommissioned INTEGER 9 AUTOSET
15683
+ CapacityFromTo REAL 10 AUTOSET
15684
+ CapacityToFrom REAL 11 AUTOSET
15685
+ LossFactorFromTo REAL 12 AUTOSET
15686
+ LossFactorToFrom REAL 13 AUTOSET
15687
+ CapacityEmergencyFromTo REAL 14 AUTOSET
15688
+ CapacityEmergencyToFrom REAL 15 AUTOSET
15689
+ R REAL 16 AUTOSET
15690
+ ReactivePowerFactorFrom REAL 17 AUTOSET
15691
+ ReactivePowerFactorTo REAL 18 AUTOSET
15675
15692
 
15676
15693
  END_DATA
15694
+ END_MASK
15695
+ //---------------------------------------------------------------------
15696
+ DEFINE_MASK CSVDATA SDDP_dclinkstatus
15697
+ DEFINE_AUTOMATIC_INFO
15698
+ FILENAME dclinkstatus.dat
15699
+ VERSION 1
15700
+ CONTEXT_READ sddpac
15701
+ CONTEXT_WRITE sddpac
15702
+ CLASSNAME PSRLinkDC
15703
+ MODEL MODL:SDDP_SimpleTwoTerminal_DCLink
15704
+ ATTRIBUTE_ID code
15705
+ END_AUTOMATIC_INFO
15677
15706
 
15707
+ DEFINE_DATA
15708
+ code REFERENCE 1
15709
+ DateStatus DATE 2 YYYY/MM/DD AUTOSET
15710
+ Status INTEGER 3 AUTOSET
15711
+ END_DATA
15712
+ DEFINE_HEADER
15713
+ $version=1
15714
+ !code,Date,Status
15715
+ END_HEADER
15678
15716
  END_MASK
15679
15717
  //---------------------------------------------------------------------
15680
15718
  DEFINE_MASK CSVDATA SDDP_dmtdclink
@@ -15772,7 +15810,7 @@ DEFINE_MASK CSVDATA SDDP_dcnvlcc
15772
15810
 
15773
15811
  DEFINE_HEADER
15774
15812
  $version=1
15775
- !Code,Name,ACBusCode,DCBusCode,GroundBusCode,ConverterType,Bridges,SecondaryVoltage,Existing,Decommissioned,NominalCurrent,Xc,MinTap,MaxTap,TapSteps,MaxDcAcCapacity,MaxAcDcCapacity,MinIgnitionAngle,MaxIgnitionAngle,DesiredIgnitionAngle,MinExtinctionAngle,MaxExtinctionAngle,DesiredExtinctionAngle,Capacitance,Frequency
15813
+ !Code,Name,ACBusCode,DCBusCode,GroundBusCode,ConverterType,Bridges,SecondaryVoltage,Existing,Decommissioned,NominalCurrent,Xc,MinTap,MaxTap,TapSteps,MaxDcAcCapacity,MaxAcDcCapacity,MinIgnitionAngle,MaxIgnitionAngle,DesiredIgnitionAngle,MinExtinctionAngle,MaxExtinctionAngle,DesiredExtinctionAngle,NominalPower,Capacitance,Frequency
15776
15814
  END_HEADER
15777
15815
 
15778
15816
  DEFINE_DATA
@@ -15799,8 +15837,9 @@ DesiredIgnitionAngle REAL 20 AUTOSET
15799
15837
  MinExtinctionAngle REAL 21 AUTOSET
15800
15838
  MaxExtinctionAngle REAL 22 AUTOSET
15801
15839
  DesiredExtinctionAngle REAL 23 AUTOSET
15802
- Capacitance REAL 24 AUTOSET
15803
- Frequency REAL 25 AUTOSET(model.parm("Frequency"))
15840
+ NominalPower REAL 24 AUTOSET
15841
+ Capacitance REAL 25 AUTOSET
15842
+ Frequency REAL 26 AUTOSET(model.parm("Frequency"))
15804
15843
  END_DATA
15805
15844
 
15806
15845
  END_MASK
@@ -15809,7 +15848,7 @@ DEFINE_MASK CSVDATA SDDP_mcnvlcc
15809
15848
 
15810
15849
  DEFINE_HEADER
15811
15850
  $version=1
15812
- !Day,Month,Year,Code,Name,ACBusCode,DCBusCode,GroundBusCode,Existing,Decommissioned,NominalCurrent,Xc,MinTap,MaxTap,TapSteps,MaxDcAcCapacity,MaxAcDcCapacity,MinIgnitionAngle,MaxIgnitionAngle,DesiredIgnitionAngle,MinExtinctionAngle,MaxExtinctionAngle,DesiredExtinctionAngle,Capacitance
15851
+ !Day,Month,Year,Code,Name,ACBusCode,DCBusCode,GroundBusCode,Existing,Decommissioned,NominalCurrent,Xc,MinTap,MaxTap,TapSteps,MaxDcAcCapacity,MaxAcDcCapacity,MinIgnitionAngle,MaxIgnitionAngle,DesiredIgnitionAngle,MinExtinctionAngle,MaxExtinctionAngle,DesiredExtinctionAngle,NominalPower,Capacitance
15813
15852
  END_HEADER
15814
15853
 
15815
15854
  DEFINE_DATA
@@ -15836,7 +15875,8 @@ DesiredIgnitionAngle REAL 20 AUTOSET
15836
15875
  MinExtinctionAngle REAL 21 AUTOSET
15837
15876
  MaxExtinctionAngle REAL 22 AUTOSET
15838
15877
  DesiredExtinctionAngle REAL 23 AUTOSET
15839
- Capacitance REAL 24 AUTOSET
15878
+ NominalPower REAL 24 AUTOSET
15879
+ Capacitance REAL 25 AUTOSET
15840
15880
  END_DATA
15841
15881
 
15842
15882
  END_MASK
@@ -16771,7 +16811,7 @@ END_AUTOMATIC_INFO
16771
16811
 
16772
16812
  DEFINE_DATA
16773
16813
  code REFERENCE 1
16774
- DateStatus DATE 2 YYYY/MM/DD AUTOSET
16814
+ DateBypass DATE 2 YYYY/MM/DD AUTOSET
16775
16815
  block INTEGER 3
16776
16816
  Bypass INTEGER 4
16777
16817
  END_DATA
@@ -16898,7 +16938,7 @@ DEFINE_DATA
16898
16938
  code REFERENCE 1
16899
16939
  DateTap DATE 2 YYYY/MM/DD AUTOSET
16900
16940
  block INTEGER 3
16901
- Tap INTEGER 4
16941
+ Tap REAL 4
16902
16942
  END_DATA
16903
16943
  DEFINE_HEADER
16904
16944
  $version=1
@@ -16946,7 +16986,7 @@ DEFINE_DATA
16946
16986
  code REFERENCE 1
16947
16987
  DateUnitsInService DATE 2 YYYY/MM/DD AUTOSET
16948
16988
  block INTEGER 3
16949
- UnitsInService REAL 4
16989
+ UnitsInService INTEGER 4
16950
16990
  END_DATA
16951
16991
  DEFINE_HEADER
16952
16992
  $version=1
@@ -17049,7 +17089,6 @@ $version=1
17049
17089
  !code,Date,block,Setpoint
17050
17090
  END_HEADER
17051
17091
  END_MASK
17052
-
17053
17092
  //---------------------------------------------------------------------
17054
17093
  //---------------------------------------------------------------------
17055
17094
  DEFINE_MASK CSVDATA SDDP_hlgc
@@ -17356,8 +17395,8 @@ DEFINE_MASK CSVDATA SDDP_genesysweights
17356
17395
  DEFINE_AUTOMATIC_INFO
17357
17396
  FILENAME genesys_weights.dat
17358
17397
  VERSION 1
17359
- CONTEXT_READ sddp
17360
- CONTEXT_WRITE sddp
17398
+ CONTEXT_READ genesys
17399
+ CONTEXT_WRITE genesys
17361
17400
  CLASSNAME PSRStudy
17362
17401
  MODEL GenesysWeights
17363
17402
  CREATE_OBJECTS TRUE
@@ -17647,6 +17686,37 @@ Element INTEGER 2
17647
17686
  ElementType INTEGER 3
17648
17687
  Coefficient REAL 4
17649
17688
  END_DATA
17689
+ END_MASK
17690
+ //---------------------------------------------------------------------
17691
+ //---------------------------------------------------------------------
17692
+ DEFINE_MASK CSVDATA SDDP_mip_dyn_conv
17693
+
17694
+ DEFINE_DATA
17695
+ Step INTEGER,1
17696
+ MaxTime REAL,2
17697
+ Tolerance REAL,3
17698
+ END_DATA
17699
+ DEFINE_HEADER
17700
+ !Step,MaxTime,Tolerance
17701
+ END_HEADER
17702
+ END_MASK
17703
+ //---------------------------------------------------------------------
17704
+ //---------------------------------------------------------------------
17705
+ DEFINE_MASK CSVDATA SDDP_ccombu
17706
+ DEFINE_HEADER
17707
+ $version=2
17708
+ !Code,Name,FuelUnit,Cost,EmissionFactor,CostType
17709
+ END_HEADER
17710
+
17711
+ DEFINE_DATA
17712
+ Code INTEGER 1
17713
+ Name STRING 2
17714
+ UComb STRING 3 AUTOSET(model.parm("UComb"))
17715
+ Custo REAL 4 AUTOSET
17716
+ EmiCO2 REAL 5 AUTOSET(model.parm("EmiCO2"))
17717
+ FlagScenario INTEGER 6 AUTOSET(model.parm("FlagScenario"))
17718
+ END_DATA
17719
+
17650
17720
  END_MASK
17651
17721
  //---------------------------------------------------------------------
17652
17722
  //---------------------------------------------------------------------
psr/factory/factorylib.py CHANGED
@@ -65,6 +65,10 @@ def initialize():
65
65
  lib.psrd_study_load.argtypes = [ctypes.c_char_p, ctypes.c_long, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
66
66
  lib.psrd_study_save.restype = ctypes.c_int
67
67
  lib.psrd_study_save.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_long, ctypes.c_void_p, ctypes.c_void_p]
68
+ lib.psrd_study_load_settings.restype = ctypes.c_void_p
69
+ lib.psrd_study_load_settings.argtypes = [ctypes.c_char_p, ctypes.c_long, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
70
+ lib.psrd_study_save_settings.restype = ctypes.c_int
71
+ lib.psrd_study_save_settings.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_long, ctypes.c_void_p, ctypes.c_void_p]
68
72
  lib.psrd_study_create.restype = ctypes.c_void_p
69
73
  lib.psrd_study_create.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
70
74
  lib.psrd_study_is_equals_to.restype = ctypes.c_int
@@ -111,6 +115,8 @@ def initialize():
111
115
  lib.psrd_study_add.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
112
116
  lib.psrd_study_remove.restype = ctypes.c_int
113
117
  lib.psrd_study_remove.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]
118
+ lib.psrd_study_get_all_objects.restype = ctypes.c_void_p
119
+ lib.psrd_study_get_all_objects.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
114
120
  lib.psrd_study_find.restype = ctypes.c_void_p
115
121
  lib.psrd_study_find.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_void_p]
116
122
  lib.psrd_study_find_by_id.restype = ctypes.c_void_p
Binary file
File without changes
@@ -0,0 +1,169 @@
1
+ """Creates SDDP 1 stage Case01 example."""
2
+ import copy
3
+ import os
4
+
5
+ import psr.factory
6
+
7
+
8
+ def get_case_path() -> str:
9
+ return os.path.join(os.path.splitext(os.path.basename(__file__))[0], "")
10
+
11
+
12
+ def create_sddp_sample_case01() -> psr.factory.Study:
13
+ blocks = 1
14
+ # Create a study object and define its basic settings.
15
+ study = psr.factory.create_study({
16
+ "Models": ["SDDP", ], # Default model: SDDP
17
+ "Blocks": blocks, # Default number of blocks: 1
18
+ "StageType": 2, # Weekly: 1 (default), Monthly: 2
19
+ })
20
+ study.from_dict({
21
+ "Description": "Caso ejemplo - DT - 1 etapa - 1 bloque",
22
+ "InitialYear": 2013,
23
+ "InitialStage": 1,
24
+ "NumberOfStages": 1,
25
+ "NumberOfSeries": 1,
26
+ })
27
+
28
+ # Study options
29
+ study.from_dict({
30
+ "Type": 2,
31
+ "InitialYearOfHydrology": 1996,
32
+ "NumberOfSystems": 1,
33
+ "AggregateInTheOperationPolicy": 0,
34
+ "UMON": "$",
35
+ "LoadSheddingInBuses": 0,
36
+ "MonitoringOfCircuitLimits": 0,
37
+ "HourlyRepresentation": 0,
38
+ "MaximumNumberOfIterations": 10,
39
+ "MinimumOutflowPenaltyHm3": 5000.0,
40
+ "DeficitSegment": [100.0, 0.0, 0.0, 0.0],
41
+ "DeficitCost": [500.0, 0.0, 0.0, 0.0],
42
+ "FutureCostStage": 4,
43
+ "FutureCostYear": 1998,
44
+ })
45
+
46
+ # Study duration
47
+ study.set("FixedDurationOfBlocks(1)", 100.0)
48
+
49
+ # By default, a study comes with one system.
50
+ system = study.get("System")[0]
51
+ system.code = 1
52
+ system.id = "s1"
53
+ system.name = "System 1"
54
+ # System's currency
55
+ system.set("SystemCurrency", "$")
56
+ # It's not required to add an existing object to the study.
57
+
58
+ # Set study to run with this unique system
59
+ study.set("CodesOfPowerSystems", [1, ])
60
+
61
+ # Create a demand segment - it's required to add at least
62
+ # an inelastic segment to a demand object.
63
+ segment = psr.factory.create("DemandSegment", study.context)
64
+ # Set demand and cost data.
65
+ segment.set_at("EnergyPerBlock(:)", "01/2013", 8.928)
66
+ # Add segment to the study.
67
+ study.add(segment)
68
+
69
+ # Create a system demand.
70
+ demand = psr.factory.create("Demand", study.context)
71
+ demand.code = 1
72
+ demand.name = "System 1"
73
+ # Associate it with the only system in the case.
74
+ demand.set("RefSystem", system)
75
+ # Associate the demand with its segments.
76
+ demand.set("RefSegments", [segment, ])
77
+ # Add demand to the study.
78
+ study.add(demand)
79
+
80
+ # Create all fuels - Thermal plants requires then.
81
+ fuel1 = psr.factory.create("Fuel", study.context)
82
+ fuel1.code = 1
83
+ fuel1.name = "Fuel 1"
84
+ fuel1.from_dict({
85
+ "Unit": "UC",
86
+ "UE": "MWh",
87
+ "Price": 0.8,
88
+ "EmissionFactor": 0.0,
89
+ "RefSystem": system,
90
+ })
91
+ study.add(fuel1)
92
+
93
+ fuel2 = psr.factory.create("Fuel", study.context)
94
+ fuel2.code = 2
95
+ fuel2.name = "Fuel 2"
96
+ fuel2.from_dict({
97
+ "Unit": "UC",
98
+ "UE": "MWh",
99
+ "Price": 1.2,
100
+ "EmissionFactor": 0.0,
101
+ "RefSystem": system,
102
+ })
103
+ study.add(fuel2)
104
+
105
+ # Create all thermal plants.
106
+ plant1 = psr.factory.create("ThermalPlant", study.context)
107
+ plant1.code = 1
108
+ plant1.name = "Thermal 1"
109
+ # Set plant's properties
110
+ t_params = {
111
+ "MaximumGenerationCapacity": 10.0,
112
+ "InstalledCapacity": 10.0,
113
+ "ThermalType": 0,
114
+ "Type": 0,
115
+ "NumberOfGeneratingUnits": 1,
116
+ "NumberOfAlternativeFuels": 0,
117
+ "CodeOfAlternativeFuels(:)": 0,
118
+ "O&MCost": 0.0,
119
+ "FuelTransportationCost": 0.0,
120
+ "SpecificConsumptionSegment(1)": 100.0,
121
+ "SpecificConsumptionSegment(2:3)": 0.0,
122
+ "SpecificConsumption(1:3,1)": 10.0,
123
+ "RefFuels": [fuel1, ],
124
+ "RefSystem": system,
125
+ }
126
+ plant1.from_dict(t_params)
127
+ for i in range(5):
128
+ pcopy = copy.copy(plant1)
129
+ pcopy.code = i + 1
130
+ study.add(pcopy)
131
+
132
+
133
+ # Use Python copy's module copy function to create
134
+ # a copy of an object.
135
+ plant2 = copy.copy(plant1)
136
+ plant2.code = 2
137
+ plant2.name = "Thermal 2"
138
+ plant2.set("MaximumGenerationCapacity", 5.0)
139
+ plant2.set("InstalledCapacity", 5.0)
140
+ plant2.set("SpecificConsumption(1:3,1)", 15.0)
141
+ plant2.set("RefFuels", [fuel1, ])
142
+ plant2.set("RefSystem", system)
143
+ study.add(plant2)
144
+
145
+ plant3 = plant2.clone()
146
+ plant3.code = 3
147
+ plant3.name = "Thermal 3"
148
+ plant3.from_dict({
149
+ "MaximumGenerationCapacity": 20.0,
150
+ "InstalledCapacity": 20.0,
151
+ "SpecificConsumption(1:3,1)": 12.5,
152
+ "RefFuels": [fuel2, ],
153
+ "RefSystem": system,
154
+ })
155
+ study.add(plant3)
156
+
157
+ return study
158
+
159
+
160
+ if __name__ == "__main__":
161
+
162
+ case_path = get_case_path()
163
+ os.makedirs(case_path, exist_ok=True)
164
+ print("Creating example case... ", end="")
165
+ study = create_sddp_sample_case01()
166
+ print(" OK.")
167
+ print("Saving example case in \"{}\"... ".format(case_path), end="")
168
+ study.save(case_path)
169
+ print(" OK.")