- 浏览: 135087 次
- 性别:
- 来自: 福建省莆田市
文章分类
最新评论
-
houruiming:
tks for your info which helps m ...
setcontent和setcontentobject用的是同一片内存 -
turingfellow:
in.tftpd -l -s /home/tmp -u ro ...
commands -
turingfellow:
LINUX下的网络设置 ifconfig ,routeLINU ...
commands -
turingfellow:
安装 linux loopbackyum install um ...
commands
<html><head><title>
jadex.examples.booktrading.seller
</title></head><body>
This package contains the seller agent as part of the booktrading scenario.
</body></html>
<!--
<H3>The seller agent sells books for its user.</H3>
The seller agent comes with a user interface in which the
human user can enter its sell book orders consisting of
a title, start price, price limit and a deadline. The agent
subsequently tries to sell the book and changes the price
according to the deadline.
-->
<agent xmlns="http://jadex.sourceforge.net/jadex"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jadex.sourceforge.net/jadex
http://jadex.sourceforge.net/jadex-0.96.xsd"
name="Seller" package="jadex.examples.booktrading.seller">
<imports>
<import>jadex.examples.booktrading.common.*</import>
<import>jadex.adapter.fipa.SFipa</import>
<import>jadex.runtime.*</import>
<import>jadex.runtime.impl.*</import>
<import>java.util.*</import>
<import>jadex.planlib.*</import>
</imports>
<capabilities>
<capability name="procap" file="jadex.planlib.Protocols"/>
<capability name="dfcap" file="jadex.planlib.DF"/>
</capabilities>
<beliefs>
<belief name="time" class="long" updaterate="1000">
<fact>System.currentTimeMillis()</fact>
</belief>
<beliefset name="orders" class="Order">
<facts evaluationmode="dynamic">
select $g.getParameter("order").getValue()
from IRGoal $g in $goalbase.getGoals("sell_book")
</facts>
</beliefset>
<belief name="initial_orders" class="Order[]" exported="true"/>
<beliefref name="cnp_filter" class="IFilter">
<concrete ref="procap.cnp_filter"/>
</beliefref>
<beliefset name="negotiation_reports" class="NegotiationReport"/>
<belief name="gui" class="Gui"/>
</beliefs>
<goals>
<achievegoal name="sell_book" recur="true" recurdelay="10000">
<parameter name="order" class="Order">
<bindingoptions>$beliefbase.initial_orders</bindingoptions>
</parameter>
<unique/>
<creationcondition>$beliefbase.initial_orders!=null</creationcondition>
<targetcondition>Order.DONE.equals($goal.order.getState())</targetcondition>
<failurecondition>$beliefbase.time > $goal.order.getDeadline().getTime()</failurecondition>
</achievegoal>
<querygoalref name="cnp_make_proposal">
<concrete ref="procap.cnp_make_proposal"/>
</querygoalref>
<achievegoalref name="cnp_execute_task">
<concrete ref="procap.cnp_execute_task"/>
</achievegoalref>
<achievegoalref name="df_register">
<concrete ref="dfcap.df_register"/>
</achievegoalref>
<achievegoalref name="df_deregister">
<concrete ref="dfcap.df_deregister"/>
</achievegoalref>
</goals>
<plans>
<plan name="make_proposal">
<parameter name="cfp" class="Object">
<goalmapping ref="cnp_make_proposal.cfp"/>
</parameter>
<parameter name="proposal" class="Object" direction="out">
<goalmapping ref="cnp_make_proposal.proposal"/>
</parameter>
<parameter name="proposal_info" class="Order" direction="out">
<goalmapping ref="cnp_make_proposal.proposal_info"/>
</parameter>
<parameterset name="suitableorders" class="Order">
<values>select Order $order from $beliefbase.orders
where $order.getTitle().equals($plan.task) &&
$order.getState().equals(Order.OPEN)
order by ($beliefbase.time - $order.getStartTime()) /
($order.getDeadline().getTime()-$order.getStartTime())</values>
</parameterset>
<body class="MakeProposalPlan" />
<!-- <body>new MakeProposalPlan()</body> -->
<trigger>
<goal ref="cnp_make_proposal"/>
</trigger>
</plan>
<plan name="execute_order">
<parameter name="proposal" class="Object">
<goalmapping ref="cnp_execute_task.proposal"/>
</parameter>
<parameter name="proposal_info" class="Object">
<goalmapping ref="cnp_execute_task.proposal_info"/>
</parameter>
<parameter name="result" class="Object">
<goalmapping ref="cnp_execute_task.result"/>
</parameter>
<body class="ExecuteOrderPlan" />
<!-- <body>new ExecuteOrderPlan()</body> -->
<trigger>
<goal ref="cnp_execute_task"/>
</trigger>
</plan>
</plans>
<expressions>
<expression name="search_reports">
select NegotiationReport $nr from $beliefbase.negotiation_reports
where $nr.getOrder().equals($order)
order by $nr.getTime()
<parameter name="$order" class="Order"/>
</expression>
</expressions>
<properties>
<!--<property name="logging.level">java.util.logging.Level.FINE</property>-->
</properties>
<configurations>
<configuration name="default">
<beliefs>
<initialbelief ref="cnp_filter">
<fact>IFilter.ALWAYS</fact>
</initialbelief>
<initialbelief ref="gui">
<fact>new Gui($agent.getExternalAccess(), false)</fact>
</initialbelief>
</beliefs>
<goals>
<initialgoal ref="df_register">
<parameter ref="description">
<value>SFipa.createAgentDescription(null, SFipa.createServiceDescription("sell",
"service_seller", "UniHH"))</value>
</parameter>
</initialgoal>
<!--<initialgoal ref="sell_book">
<parameter ref="order">
<value>new Order("All about agents", new Date(
System.currentTimeMillis()+60000), 85, 65, false)</value>
</parameter>
</initialgoal>-->
<endgoal ref="df_deregister"/>
</goals>
</configuration>
</configurations>
</agent>package jadex.examples.booktrading.seller;
import jadex.examples.booktrading.common.NegotiationReport;
import jadex.examples.booktrading.common.Order;
import jadex.runtime.Plan;
import java.util.Date;
/**
* Execute the order by setting execution price and date.
*/
public class ExecuteOrderPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
// Extract order data.
Integer price = (Integer)getParameter("proposal").getValue();
Order order = (Order)getParameter("proposal_info").getValue();
// Initiate payment and delivery.
// IGoal pay = createGoal("payment");
// pay.getParameter("order").setValue(order);
// dispatchSubgoalAndWait(pay);
// IGoal delivery = createGoal("delivery");
// delivery.getParameter("order").setValue(order);
// dispatchSubgoalAndWait(delivery);
// Save successful transaction data.
order.setExecutionPrice(price);
order.setExecutionDate(new Date());
String report = "Sold for: "+price;
NegotiationReport nr = new NegotiationReport(order, report, System.currentTimeMillis());
getBeliefbase().getBeliefSet("negotiation_reports").addFact(nr);
getParameter("result").setValue(price);
}
}
package jadex.examples.booktrading.seller;
import jadex.examples.booktrading.common.NegotiationReport;
import jadex.examples.booktrading.common.Order;
import jadex.runtime.Plan;
/**
* The plan has the purpose to make an proposal for selling a book.
*/
public class MakeProposalPlan extends Plan
{
/**
* The body method is called on the
* instatiated plan instance from the scheduler.
*/
public void body()
{
// Search suitable open orders.
// Order[] suitableorders = (Order[])getParameterSet("suitableorders").getValues();
Order order = (Order)createExpression("select one Order $order from $beliefbase.orders"
+ " where $order.getTitle().equals($task) && $order.getState().equals(Order.OPEN)"
+ " order by ($beliefbase.time - $order.getStartTime()) / ($order.getDeadline().getTime()-$order.getStartTime())")
.execute("$task", getParameter("cfp").getValue());
// Use most urgent order for preparing proposal.
// if(suitableorders.length > 0)
if(order!=null)
{
// Order order = suitableorders[0];
double time_span = order.getDeadline().getTime() - order.getStartTime();
double elapsed_time = System.currentTimeMillis() - order.getStartTime();
double price_span = order.getLimit() - order.getStartPrice();
int acceptable_price = (int)(price_span * elapsed_time / time_span) + order.getStartPrice();
getLogger().info(getAgentName()+" proposed: " + acceptable_price);
// Store proposal data in plan parameters.
getParameter("proposal").setValue(new Integer(acceptable_price));
getParameter("proposal_info").setValue(order);
String report = "Made proposal: "+acceptable_price;
NegotiationReport nr = new NegotiationReport(order, report, System.currentTimeMillis());
getBeliefbase().getBeliefSet("negotiation_reports").addFact(nr);
}
}
}
发表评论
-
protocols
2011-04-03 19:22 924<!-- The protocols capabilit ... -
dfcap
2011-04-03 19:15 874<!-- The df capability has a ... -
booktrading / manager
2011-03-29 23:18 1086<html><head><tit ... -
booktrading / common
2011-03-29 23:17 985<html><head><tit ... -
booktrading / buyer
2011-03-29 23:13 843<!-- <H3>The buyer age ... -
tomcat的context说明书
2011-03-20 17:39 803http://tomcat.apache.org/tomcat ... -
msyql的select语法
2010-09-13 22:52 107513.2.7. SELECT语法 13.2.7.1. ... -
zotero与word集成
2010-09-11 08:50 1765Manually Installing the Zotero ... -
university 2/n
2010-08-24 07:54 896Chapter 1.Introduction of regis ... -
university 1/n
2010-08-24 07:53 938chapter? Introduction ?.?The st ... -
Sun Java Bugs that affect lucene
2010-08-23 08:59 734Sometimes Lucene runs amok of b ... -
Snowball分词
2010-08-22 13:07 1222using System; using Lucene.Net. ... -
penn tree bank 6/6
2010-08-20 07:09 91711 This use of 12 Contact the - ... -
penn tree bank 5/n
2010-08-19 07:40 920always errs on the side of caut ... -
penn tree bank 4/n
2010-08-19 07:39 8164. Bracketing 4.1 Basic Methodo ... -
penn tree bank 3/n
2010-08-15 23:31 8182.3.1 Automated Stage. During t ... -
penn tree bank 2/n
2010-08-15 23:30 1503Mitchell P Marcus et al. Buildi ... -
capabilities 3/3
2010-08-11 22:58 77401<capability xmlns="ht ... -
capabilities 2/3
2010-08-11 22:57 737Fig.3.Element creation cases:a) ... -
capabilities 1/3
2010-08-11 22:56 947Extending the Capability Concep ...
相关推荐
$ composer require linio/seller-center-sdk 快速开始 配置 要与卖方中心平台进行交互,您需要询问UserID和API KEY,并知道您将使用的服务的URL和版本。 这些值将通过以下Configuration对象使用。 $ ...
- 马来西亚:https://seller.shopee.com.my/ - 台湾:https://seller.shopee.tw/ - 泰国:https://seller.shopee.co.th/ - 菲律宾:https://seller.shopee.ph/ - 印度尼西亚:https://seller.shopee.co.id/ - ...
### Ozon Seller 中国详细实操流程 #### 一、店铺注册步骤详解 **1. 搜索并访问 Ozon Seller 中国网站** - **网址**: [https://seller.ozon.ru/ch/](https://seller.ozon.ru/ch/) - **操作步骤**: - 打开网页...
ISkyShop商城系统V1.1正式版结合5年的电商开发实践,经过1年多的开发强力推出,圆你轻松搭建电子商务网络平台的梦想!您的需要就是我们的动力,希望您在使用的同时,对我们提出宝贵意见,共同推动iskyshop的发展。...
【团购】是一个典型的在线电子商务模式,它通过集体购买的方式为消费者提供优惠的商品或服务。... 这个团购系统的核心功能可以通过给出的文件名来推测: ... ...- **安全机制**:检查代码中是否有防止SQL注入、XSS攻击等...
<Seller>BillGates</Seller> </Shop> 上海电脑城</Name> <Phone>123456789</Phone> <Seller>BillGates</Seller> </Shop> </ShopInformation> <Name>PCSTORE</Name> <Phone>123456789</Phone> ...
1.在main.js中导入vue-router和组件...import seller from './components/seller/seller'; 2.为组件设置URL,通过url可以动态的加载组件 const urls = [ { path: '/goods', component: goods }, { path: '/rating', c
**osCommerce Best Seller 插件详解** osCommerce 是一个开源的电子商务解决方案,它提供了一整套功能,允许商家在线创建并管理自己的网上商店。而"Best Seller"插件是osCommerce平台上的一个重要组件,它的主要...
3、校验通知中的seller_id(或者seller_email)是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email), 4、验证app_id是否为调用方的appid。 三、demo的运行环境:...
MySQL_学习笔记_索引使用章节_tb-seller表插入语句
3、校验通知中的seller_id(或者seller_email) 是否为该笔交易对应的操作方(一个商户可能有多个seller_id/seller_email) 4、验证接口调用方的app_id。 MAVEN引入: <groupId>com.alipay.sdk</groupId> ...
3、校验通知中的seller_id(或者seller_email) 是否为该笔交易对应的操作方(一个商户可能有多个seller_id/seller_email) 4、验证接口调用方的app_id ※说明※ 本demo仅仅为学习参考使用,请根据实际情况自行...
Android文档工具合集Android文档工具合集Android文档工具合集Android文档工具合集
Modules/Seller/Conf/db.php 3、配置SSL证书,开启强制HTTPS,伪静态设置TP,建议用宝塔面板设置 目录权限: Runtime 可写 777 Data 可写 777 Uploads 可写 777 后台访问地址:域名/seller.php 账号;admin 密码:...
<Seller>Bill Gates</Seller> </Shop> <!-- ...其他Shop元素... --> </ShopInformation> </Root> ``` 在这个例子中,XML文档包含了一个`Root`元素,里面有两个`ShopInformation`子元素,每个`ShopInformation`...
这段代码在Vue组件创建时发送GET请求到`/api/seller`,并将返回的数据赋值给组件的`seller`属性。同样的方式可以用于获取`/goods`和`/ratings`的数据。 总结一下,本篇文章主要讲解了在Vue CLI项目中如何利用vue-...
【亚马逊成为Best Seller秘籍】 在亚马逊这个全球最大的电商平台中,成为Best Seller是许多卖家梦寐以求的目标,因为这不仅意味着销量的显著增长,还会为产品带来巨大的曝光度和信誉提升。要实现这一目标,卖家需要...
1.登录卖家平台,网址为http://seller.shopee.co.id 2.复制脚本https://docs.google.com/spreadsheets/d/1po6PyIc4yx6JYRTyKW9hfPFtryeQpovT0Hk1rp6hCnk/copy 3. Masukan链接产品和di Bagian链接产品4 。Klik“ Auto...
Tool4seller的亚马逊卖家插件,可以在卖家访问亚马逊前台页面时,分析商品Listing的标题、图片、评论等各项指标,发现Listing的优缺点,协助您全面提升Listing的质量。 Tool4seller的亚马逊卖家插件,是tool4seller...