private HashSet <GraphInfo> BuildPosition(HashSet <long> conIDs) { HashSet <GraphInfo> position = new HashSet <GraphInfo>(); foreach (long ID in conIDs) { GraphInfo contract; if (graphCache.GetGraphInfo(ID, out contract)) { position.Add(contract); } else { GraphBuilder builder = new GraphBuilder(graphCache); ExposureDataAdaptor expData = graphCache.GetExposure(ID); GraphType type = graphCache.GetSettings(ID).GraphType; IRITEindexMapper mapper = GetMapper(expData); contract = builder.MakeGraph(type, expData, mapper); graphCache.Add(ID, contract); position.Add(contract); } } return(position); }
private IRITEindexMapper GetMapperForContract(ExposureDataAdaptor expData) { IRITEindexMapper indexMapper; if (GraphCache.GetIndexMapper(expData.ContractID, out indexMapper)) { return(indexMapper); } else { RAPSettings rapsettings = GraphCache.GetSettings(expData.ContractID).RAPsettings; indexMapper = new RITEmapper1(expData, rapsettings, new RMSSubPerilConfig()); GraphCache.Add(expData.ContractID, indexMapper); return(indexMapper); } }