Examples of Leg


Examples of org.jquantlib.cashflow.Leg

    }

    protected Bond(final /* @Natural */int settlementDays,
                 final Calendar calendar,
                 final Date issueDate) {
        this(settlementDays, calendar, issueDate, new Leg());
    }
View Full Code Here

Examples of org.jquantlib.cashflow.Leg

        this.maturityDate_ = maturityDate.clone();
        this.issueDate_ = issueDate.clone();
       
        this.notionalSchedule_ = new ArrayList<Date>();
        this.notionals_ = new ArrayList<Double>();
        this.redemptions_ = new Leg();

        if (!cashflows.isEmpty()) {
            notionalSchedule_.add(new Date());
            notionals_.add(faceAmount);
View Full Code Here

Examples of org.jquantlib.cashflow.Leg

    protected Bond(final /* @Natural */int settlementDays,
                 final Calendar calendar,
                 final /* @Real */double faceAmount,
                 final Date maturityDate) {
        this(settlementDays, calendar, faceAmount, maturityDate, new Date(), new Leg());
    }
View Full Code Here

Examples of org.jquantlib.cashflow.Leg

    protected Bond(final /* @Natural */int settlementDays,
                 final Calendar calendar,
                 final /* @Real */double faceAmount,
                 final Date maturityDate,
                 final Date issueDate) {
        this(settlementDays, calendar, faceAmount, maturityDate, issueDate, new Leg());
    }
View Full Code Here

Examples of org.jquantlib.cashflow.Leg

        // QL.require(Bond.Results.class.isAssignableFrom(results.getClass()), ReflectConstants.WRONG_ARGUMENT_TYPE); // QA:[RG]::verified

        final Bond.ArgumentsImpl a = (Bond.ArgumentsImpl)arguments_;
        final Bond.ResultsImpl   r = (Bond.ResultsImpl)results_;

      final Leg cashflows = a.cashflows;
      final Date settlementDate = a.settlementDate;
      final Date valuationDate = discountCurve.currentLink().referenceDate();
        QL.require(! discountCurve.empty() , "no discounting term structure set"); //// TODO: message

        r.value           = CashFlows.getInstance().npv(cashflows, discountCurve, valuationDate,  valuationDate);
View Full Code Here

Examples of org.jquantlib.cashflow.Leg

                            new Brazil(Brazil.Market.SETTLEMENT),
                            BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted,
                            DateGeneration.Rule.Backward, false);

          // fixed coupons
          final Leg cashflows =
              new FixedRateLeg(schedule, new Actual360())
              .withNotionals(faceAmount)
              .withCouponRates(couponRates)
              .withPaymentAdjustment(BusinessDayConvention.ModifiedFollowing).Leg();
          // redemption
          cashflows.add(new SimpleCashFlow(faceAmount, cashflows.last().date()));

          final Bond bond = new Bond(settlementDays, new Brazil(Brazil.Market.SETTLEMENT),
                    faceAmount, cashflows.last().date(),
                    new Date(1,Month.January,2007), cashflows);

          final double cachedPrice = prices[bondIndex];

          final double price = faceAmount*bond.dirtyPrice(yield.rate(),
 
View Full Code Here

Examples of org.opentripplanner.api.model.Leg

                /* fix up from/to on first/last legs */
                if (i.legs.size() == 0) {
                    LOG.warn("itinerary has no legs");
                    continue;
                }
                Leg firstLeg = i.legs.get(0);
                firstLeg.from.orig = plan.from.orig;
                Leg lastLeg = i.legs.get(i.legs.size() - 1);
                lastLeg.to.orig = plan.to.orig;
            }
        }
        options.rctx.debugOutput.finishedRendering();
        return plan;
View Full Code Here

Examples of org.opentripplanner.api.model.Leg

     * @param states The array of states to base the leg on
     * @param showIntermediateStops Whether to include intermediate stops in the leg or not
     * @return The generated leg
     */
    private Leg generateLeg(Graph graph, State[] states, boolean showIntermediateStops) {
        Leg leg = new Leg();

        Edge[] edges = new Edge[states.length - 1];

        leg.startTime = makeCalendar(states[0]);
        leg.endTime = makeCalendar(states[states.length - 1]);

        // Calculate leg distance and fill array of edges
        leg.distance = 0.0;
        for (int i = 0; i < edges.length; i++) {
            edges[i] = states[i + 1].getBackEdge();
            leg.distance += edges[i].getDistance();
        }

        addModeAndAlerts(graph, leg, states);

        TimeZone timeZone = leg.startTime.getTimeZone();
        leg.agencyTimeZoneOffset = timeZone.getOffset(leg.startTime.getTimeInMillis());

        addTripFields(leg, states);

        addPlaces(leg, states, edges, showIntermediateStops);

        if (leg.isTransitLeg()) addRealTimeData(leg, states);

        CoordinateArrayListSequence coordinates = makeCoordinates(edges);
        Geometry geometry = GeometryUtils.getGeometryFactory().createLineString(coordinates);

        leg.legGeometry = PolylineEncoder.createEncodings(geometry);
View Full Code Here

Examples of org.opentripplanner.api.model.Leg

        TestPlanner planner = new TestPlanner(
                "portland", "From::NE 43RD AVE at NE GLISAN ST", "To::NE 43RD AVE at NE ROYAL CT");

        Response response = planner.getItineraries();
        Itinerary itinerary = response.getPlan().itinerary.get(0);
        Leg leg = itinerary.legs.get(0);
        List<WalkStep> steps = leg.walkSteps;
        assertEquals(3, steps.size());
        WalkStep step0 = steps.get(0);
        WalkStep step2 = steps.get(2);
        assertEquals(AbsoluteDirection.NORTH, step0.absoluteDirection);
View Full Code Here

Examples of org.opentripplanner.api.model.Leg

        TestPlanner planner = new TestPlanner(
                "portland", "SE 47TH AVE at SE ASH ST", "NE 47TH AVE at NE COUCH ST");
        Response response = planner.getItineraries();

        Itinerary itinerary = response.getPlan().itinerary.get(0);
        Leg leg = itinerary.legs.get(0);
        List<WalkStep> steps = leg.walkSteps;
        assertEquals(2, steps.size());
        WalkStep step0 = steps.get(0);
        WalkStep step1 = steps.get(1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.