Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
remind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jerome Hilaire
remind
Commits
9e65084b
Commit
9e65084b
authored
5 years ago
by
Marianna Rottoli
Browse files
Options
Downloads
Patches
Plain Diff
Iterative EDGE-T supports edgeTrpLib and data preparation inconv_comp branches.
parent
98970e21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!159
Pullreq1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/iterative/EDGE_transport.R
+14
-3
14 additions, 3 deletions
scripts/iterative/EDGE_transport.R
with
14 additions
and
3 deletions
scripts/iterative/EDGE_transport.R
+
14
−
3
View file @
9e65084b
...
...
@@ -11,7 +11,9 @@ opt = parse_args(opt_parser);
library
(
data.table
)
library
(
gdx
)
library
(
gdxdt
)
library
(
edgeTrpLib
)
#library(edgeTrpLib)
require
(
devtools
)
load_all
(
"../../../../../../edgetrplib/"
)
## this library has to be on the inconv_comp branch
library
(
rmndt
)
library
(
moinput
)
...
...
@@ -86,6 +88,14 @@ pref_data = inputdata$pref_data
## Moinput produces all combinations of iso-vehicle types and attributes a 0. These ghost entries have to be cleared.
int_dat
=
int_dat
[
EJ_Mpkm_final
>
0
]
pref_data
$
FV_final_pref
=
merge
(
pref_data
$
FV_final_pref
,
unique
(
int_dat
[,
c
(
"iso"
,
"vehicle_type"
)]),
by
=
c
(
"iso"
,
"vehicle_type"
),
all.y
=
TRUE
)
pref_data
$
FV_final_pref
[,
check
:=
sum
(
value
),
by
=
c
(
"vehicle_type"
,
"iso"
)]
pref_data
$
FV_final_pref
=
pref_data
$
FV_final_pref
[
check
>
0
]
pref_data
$
FV_final_pref
[,
check
:=
NULL
]
pref_data
$
VS1_final_pref
=
merge
(
pref_data
$
VS1_final_pref
,
unique
(
int_dat
[,
c
(
"iso"
,
"vehicle_type"
)]),
by
=
c
(
"iso"
,
"vehicle_type"
),
all.y
=
TRUE
)
pref_data
$
VS1_final_pref
[,
check
:=
sum
(
sw
),
by
=
c
(
"vehicle_type"
,
"iso"
)]
pref_data
$
VS1_final_pref
=
pref_data
$
VS1_final_pref
[
check
>
0
]
pref_data
$
VS1_final_pref
[,
check
:=
NULL
]
## optional average of prices
average_prices
=
FALSE
...
...
@@ -104,8 +114,9 @@ if (file.exists(datapath("demand_previousiter.RDS"))) {
ES_demandpr
=
readRDS
(
datapath
(
"demand_previousiter.RDS"
))
## load previus iteration number of stations
stations
=
readRDS
(
datapath
(
"stations.RDS"
))
## calculate non fuel costs and
nonfuel_costs
=
applylearning
(
gdx
,
REMINDmapping
,
EDGE2teESmap
,
demand_BEVtmp
,
ES_demandpr
)
## calculate non fuel costs for technologies subjected to learning and merge the resulting values with the historical values
nonfuel_costs
=
merge
(
nonfuel_costs
,
unique
(
int_dat
[,
c
(
"iso"
,
"vehicle_type"
)]),
by
=
c
(
"iso"
,
"vehicle_type"
),
all.y
=
TRUE
)
nonfuel_costs
=
applylearning
(
non_fuel_costs
,
gdx
,
REMINDmapping
,
EDGE2teESmap
,
demand_BEVtmp
,
ES_demandpr
)
saveRDS
(
nonfuel_costs
,
"nonfuel_costs_learning.RDS"
)
}
else
{
stations
=
NULL
...
...
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