Code covered by the BSD License
-
Incentives(varargin)
INCENTIVES M-file for Incentives.fig
-
LoadOk(varargin)
LOADOK M-file for LoadOk.fig
-
NodeView(varargin)
NODEVIEW M-file for NodeView.fig
-
Nodo(varargin)
NODO M-file for Nodo.fig
-
Parameters(varargin)
PARAMETERS M-file for Parameters.fig
-
ResultsExplorer(varargin)
RESULTSEXPLORER M-file for ResultsExplorer.fig
-
SCRS(varargin)
Supply Chain Risk Simulator (SCRS)
-
SCRSTuple(varargin)
SCRSTUPLE M-file for SCRSTuple.fig
-
SCRSTuple_Incentive(varargin)
SCRSTUPLE_INCENTIVE M-file for SCRSTuple_Incentive.fig
-
SCRStart(varargin)
SCRSTART M-file for SCRStart.fig
-
SupplyChain(varargin)
SUPPLYCHAIN M-file for SupplyChain.fig
-
SupplyChainMonitor(varargin)
SUPPLYCHAINMONITOR M-file for SupplyChainMonitor.fig
-
A1=coalition(n);
-
DefineSubPieces(elem,indice,f...
testare
-
Payoff_SCRS(SuppliersNew,fiel...
ind incice del parametro di SuppierNew da far variare
-
Payoff_SCRS_conjunct(Supplier...
mi salvo anche i vari scenari che si generano tenendo le allocazioni x e
-
Payoff_SCRS_conjunct2(Supplie...
disp('Payoff computation');
-
RDFtoMAT(RDF)
trasforma l'RDF nella struttura matlab da usare SCRS
-
S=shap1(n,v);
This program determines the shapley value .Shapley value is one of
-
Simplex_SCRS(SuppliersNew,Tim...
matrice di connessioni per il simplesso per il tempo
-
[probability,contextstr]=Prob...
-
[t,K]=curvature(b,N)
-
[t,x,y]=get_points(b,N)
-
[xp,yp,t,d]=calculate_distanc...
Calculate distance between bezier curve and a point
-
c=recalculate_coeffs(b)
function c=recalculate_coeffs(b)
-
c=recalculate_points(b)
function c=recalculate_points(b)
-
display(b)
function display(b)
-
easy_draw(b)
function easy_draw(b)
-
edit_bezier(varargin)
-
fixdec(x, n)
FIXDEC Round towards zero with a specified number of decimals.
-
l=length(b,N)
-
parseRDF(filename)
PARSEXML Convert XML file to a MATLAB structure.
-
parseXML(filename)
PARSEXML Convert XML file to a MATLAB structure.
-
show_curve(b)
function show_curve(b)
-
subsasgn(b,index,val)
-
v=subsref(c,index)
-
varargout=edit_curve(varargin...
WYSIWYG editor for bezier curve
-
varargout=edit_curve_Payoff(v...
WYSIWYG editor for bezier curve
-
bezier(varargin)
construction of a Bezier curve
-
AttacksPayoff_Computation.m
-
Conditional_ProbabilityTable.m
-
Conditional_Probability_Compu...
-
Incentive_Computation.m
-
Replaceability_Computation.m
-
ShapleyDelta_Computation.m
-
View all files
from
Supply Chain Risk Simulator (SCRS)
by Marco Anisetti
Supply Chain simulator for risk assessment and incentive schemes.
|
| ShapleyDelta_Computation.m |
% Shapley computation is really time consuming
% if already computed for a particular chain let
% use it
if exist(strcat(handles.File,'.mat'))~=2
% prepare the dataset for shapley computation
A=coalition(length(ActiveSuppliers));
[righe,colonne]=size(A);
v=[];
for i=1:1:righe
NumElem=length(ActiveSuppliers(find(A(i,:))));
ActiveElementIndex=ActiveSuppliers(find(A(i,:)));
MaskShapley=zeros(1,length(ActiveSuppliers));
for j=1:1:NumElem
if (SuppliersNew(1).Demand>SuppliersNew(ActiveElementIndex(j)).ProdCap)
MaskShapley=[MaskShapley;SuppliersNew(ActiveElementIndex(j)).MaskShapley*SuppliersNew(ActiveElementIndex(j)).ProdCap];
else
MaskShapley=[MaskShapley;SuppliersNew(ActiveElementIndex(j)).MaskShapley*SuppliersNew(1).Demand];
end
end
if not(isfield(handles, 'funzione'))
disp ('error: values function is not loaded in mat format')
return
end
MaskShapleyaux=MaskShapley;
MaskShapley=sum(MaskShapley);
if (eval(handles.funzione))
produzione=eval(handles.funzione);
valore=SuppliersNew(1).UnitProdCost*produzione;
v=[v,valore];
else
v=[v,0];
end
end
v=[v,SuppliersNew(1).UnitProdCost*SuppliersNew(1).Demand];
% compute the shapley
ShapleyValues=shap1(length(ActiveSuppliers),v);
save(strcat(handles.File,'.mat'),'ShapleyValues');
else
load(strcat(handles.File,'.mat'));
end
for i=1:1:length(SuppliersNew)
ShapleyDelta(i)=SuppliersNew(i).Demand*SuppliersNew(i).UnitProdCost;
end
%Shapley Delta
disp('Shapley Delta computation');
ShapleyValuesOrig=ShapleyValues;
ShapleyDeltaOrig=(ShapleyValues-ShapleyDelta);
ShapleyDeltaOrig(ShapleyDeltaOrig<0)=0;
ShapleyDelta=(ShapleyValues-ShapleyDelta)./ShapleyValues;
ShapleyDelta(ShapleyDelta<0)=0;
|
|
Contact us at files@mathworks.com