Flex Event Tips

Event Reference: http://www.w3.org/TR/DOM-Level-3-Events/events.html

hasEventListener() method returns true if an event listener is found for that specific event type on a particular display list object.
The willTrigger() method checks for event listeners on a particular display list object, but it also checks for listeners on all of that display list object's ancestors for all phases of the event flow. The method returns true if it finds one.

addEventListener() useCapture parameter -- If useCapture  is set to true  , the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture  is false  , the listener processes the event only during the target or bubbling phase.  To listen for the event in all three phases, call addEventListener  twice, once with useCapture  set to true  , then again with useCapture  set to false  .

You can remove only event listeners that you added with the addEventListener() method in an ActionScript block. You cannot remove an event listener that was defined in the MXML tag, even if it was registered using a call to the addEventListener() method that was made inside a tag attribute.

During each of these phases, the nodes have a chance to react to the event. For example, assume the user clicks a Button control that is inside a VBox container. During the capturing phase, Flex checks the Application object and the VBox for listeners to handle the event. Flex then triggers the Button's listeners in the target phase. In the bubbling phase, the VBox and then the Application are again given a chance to handle the event but now in the reverse order from the order in which they were checked in the capturing phase.

Detecting the event phase
You can determine what phase you are in by using the Event object's eventPhase property. This property contains an integer that represents one of the following constants:
    * 1 -- Capturing phase (CAPTURING_PHASE)
    * 2 -- Targeting phase (AT_TARGET)
    * 3 -- Bubbling phase (BUBBLING_PHASE)
    
Capturing phase
In the capturing phase, Flex examines an event's ancestors in the display list to see which ones are registered as a listener for the event. Flex starts with the root ancestor and continues down the display list to the direct ancestor of the target. In most cases, the root ancestors are the Stage, then the SystemManager, and then the Application object.

For example, if you have an application with a Panel container that contains a TitleWindow container, which in turn contains a Button control, the structure appears as follows:

Application
    Panel
        TitleWindow
            Button

If your listener is on the click event of the Button control, the following steps occur during the capturing phase if capturing is enabled:

   1. Check the Application container for click event listeners.
   2. Check the Panel container for click event listeners.
   3. Check the TitleWindow container for click event listeners.
    
Targeting phase

In the targeting phase, Flex invokes the event dispatcher's listeners. No other nodes on the display list are examined for event listeners. The values of the currentTarget and the target properties on the Event object during the targeting phase are the same.

Bubbling phase

In the bubbling phase, Flex examines an event's ancestors for event listeners. Flex starts with the dispatcher's immediate ancestor and continues up the display list to the root ancestor. This is the reverse of the capturing phase.

For example, if you have an application with a Panel container that contains a TitleWindow container that contains a Button control, the structure appears as follows:

Application
    Panel
        TitleWindow
            Button


If your listener is on the click event of the Button control, the following steps occur during the bubble phase if bubbling is enabled:

   1. Check the TitleWindow container for click event listeners.
   2. Check the Panel container for click event listeners.
   3. Check the Application container for click event listeners.

   
The following example displays the current phase and current target's ID:
<?xml version="1.0"?>
<!-- events/DisplayCurrentTargetInfo.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
        import mx.controls.Alert;

        private function showInfo(e:MouseEvent):void {
            Alert.show("Phase: " + e.eventPhase + "/n" +
                "Current Target: " + e.currentTarget.id);
        }
    ]]></mx:Script>

    <mx:Button id="b1"
        label="Click Me"
        click="showInfo(event)"
    />

</mx:Application>

Stopping propagation
During any phase, you can stop the traversal of the display list by calling one of the following methods on the Event object:
    * stopPropagation()
    * stopImmediatePropagation()
    The stopPropagation() method prevents the Event object from moving on to the next node, but only after any other event listeners on the current node are allowed to execute.
    The stopImmediatePropagation() method also prevents the Event objects from moving on to the next node, but it does not allow any other event listeners on the current node to execute.
    
Event priorities
<?xml version="1.0"?>
<!-- events/ShowEventPriorities.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()">
    <mx:Script><![CDATA[
        private function returnResult(e:Event):void {
            ta1.text += "returnResult() method called last (priority 1)/n";  
        }
        private function verifyInputData(e:Event):void {
            ta1.text += "verifyInputData() method called first (priority 3)/n";  
        }
        private function saveInputData(e:Event):void {
            ta1.text += "saveInputData() method called second (priority 2)/n";  
        }
        private function initApp():void {
            b1.addEventListener(MouseEvent.CLICK, returnResult, false, 1);
            b1.addEventListener(MouseEvent.CLICK, saveInputData, false, 2);
            b1.addEventListener(MouseEvent.CLICK, verifyInputData, false, 3);
        }
    ]]></mx:Script>
    <mx:Button id="b1" label="Click Me"/>   
    <mx:TextArea id="ta1" height="200" width="300"/>   
</mx:Application>
You can set the event priority to any valid integer, positive or negative. The default value is 0. If multiple listeners have the same priority, Flex calls them in the order in which they were registered.
If you want to change the priority of an event listener once the event listener has already been defined, you must remove the listener by calling the removeEventListener() method. You add the event again with the new priority.

The useWeakReference parameter allows you to specify whether the reference to the listener function is weak or normal. Setting this parameter to true allows you to avoid situations in which listener functions persist in memory even though they are no longer needed. Flash Player and AIR use a technique called garbage collection to clear objects from memory that are no longer in use. An object is considered no longer in use if no references to it exist. The garbage collector disregards weak references, which means that a listener function that has only a weak reference pointing to it is eligible for garbage collection.

One important consequence of this parameter involves working with display objects' events. Normally, you might expect a display object to be removed from memory when it is removed from the display list. However, if other objects have subscribed as listeners to that display object, with the useWeakReference parameter set to false (the default), the display object will continue to exist in Flash Player's or AIR's memory even though it no longer appears on the screen. To work around this issue, either have all the listeners subscribe to the display object with the useWeakReference parameter set to true, or else remove all the event listeners from the display object using the removeEventListener() method.



<template> <view :style="colorStyle"> <view class="h-120 flex-between-center px-20"> <view class="h-72 bg--w111-f5f5f5 rd-36rpx px-32 flex-1 flex-y-center relative"> <text class="iconfont icon-ic_search text--w111-999"></text> <input type="text" confirm-type="search" placeholder="请输入要查询的内容" @confirm="inputConfirm" @input="setValue" class="fs-28 w-438 text--w111-333 pl-18 line1" v-model="searchValue" /> <text class="iconfont icon-ic_close1 fs-28 text--w111-999 z-10" v-show="searchValue" @tap="clearSearchVal"></text> </view> <view class="fs-28 text--w111-333 ml-32" @tap='searchBut'>搜索</view> </view> <view class="px-20" v-if="history.length"> <view class="flex-between-center mt-16 mb-24"> <view class="fs-28 lh-40rpx fw-500 text--w111-333">历史搜索</view> <text class="iconfont icon-ic_delete fs-28 text--w111-999" @tap="clear"></text> </view> <view class="flex flex-wrap"> <text class="flex-center h-56 line1 rd-28rpx bg--w111-f5f5f5 px-24 fs-24 text--w111-666 mr-24 mb-16" v-for="(item,index) in isShowMore ? history : history.slice(0,7)" :key="index" @tap='setHotSearchValue(item.keyword)' v-if="item.keyword">{{item.keyword}}</text> <view class="w-56 h-56 rd-28rpx bg--w111-f5f5f5 flex-center text--w111-666" v-if="history.length > 7" @tap="isShowMore = !isShowMore"> <text class="iconfont fs-24" :class="isShowMore ? 'icon-ic_uparrow' : 'icon-ic_downarrow'"></text> </view> </view> </view> <view class="px-20"> <view class="flex-between-center mt-40 mb-24"> <view class="fs-28 lh-40rpx fw-500 text--w111-333">热门搜索</view> <text class="iconfont icon-ic_Refresh fs-28 text--w111-999" :class="isSpin ? 'spin' : ''" @tap="refresh"></text> </view> <view class="flex flex-wrap"> <view class="flex-center search_item h-56 rd-28rpx px-24 fs-24 mr-24 mb-16" v-for="(item,index) in hotSearchList" :key="index" :style="{'color':item.color,'background-color':item.bg_color,border: item.border_color ? '1px solid ' + item.border_color : 'none'}" @tap='setHotSearchValue(item.name)'> <view class="flex-y-center"> <image v-if="item.icon" :src="item.icon" class="w-24 h-24 rd-4rpx mr-8"></image> <text>{{item.name}}</text> </view> </view> </view> </view> <view> <scroll-view scroll-x="true" class="white-nowrap vertical-middle w-730 mt-32 pl-20" show-scrollbar="false"> <view class="inline-block mr-20" v-if="salesRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(1)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">销量</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="salesRecommendList[0]" @tap="goDetail(salesRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[0].store_name}}</view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="salesRecommendList[1]" @tap="goDetail(salesRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="salesRecommendList[2]" @tap="goDetail(salesRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="salesRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{salesRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{salesRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in salesRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodkd.png"></image><text style="vertical-align:middle;">{{item.store_name}}</text></text> </view> </view> </view> </view> </view> <view class="inline-block mr-20" v-if="scoreRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(2)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">评分</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="scoreRecommendList[0]" @tap="goDetail(scoreRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[0].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="scoreRecommendList[1]" @tap="goDetail(scoreRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="scoreRecommendList[2]" @tap="goDetail(scoreRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="scoreRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{scoreRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{scoreRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in scoreRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodkd.png"></image>{{item.store_name}}</text> </view> </view> </view> </view> </view> <view class="inline-block mr-20" v-if="collectRecommendList.length"> <view class="w-454 rd-24rpx gradient_bg pt-22 pb-8"> <view class="fs-28 font-red lh-40rpx fw-600 pl-24 mb-18 flex-y-center" @tap="goRank(3)"> <image src="@/static/img/sales_icon.png" class="w-40 h-40"></image> <text class="pl-8">收藏</text> </view> <view class="mx-8 rd-24rpx bg--w111-fff h-748 p-20"> <view class="flex-y-center" v-if="collectRecommendList[0]" @tap="goDetail(collectRecommendList[0])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[0].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count1 fs-24 text--w111-fff flex-center">1</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[0].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[0].store_info}}</view> </view> </view> <view class="flex-y-center mt-16" v-if="collectRecommendList[1]" @tap="goDetail(collectRecommendList[1])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[1].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count2 fs-24 text--w111-fff flex-center">2</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[1].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[1].store_info}}</view> </view> </view> <view class="flex-y-center mt-16 mb-34" v-if="collectRecommendList[2]" @tap="goDetail(collectRecommendList[2])"> <view class="relative w-108 h-108"> <image :src="collectRecommendList[2].image" class="w-108 h-108 rd-16rpx"></image> <view class="rank-count rank-count3 fs-24 text--w111-fff flex-center">3</view> </view> <view class="flex-1 h-108 flex-col flex-x-center ml-16"> <view class="flex-between-center"> <view class="w-260 fs-26 text--w111-333 lh-40rpx line1">{{collectRecommendList[2].store_name}}</view> </view> <view class="w-260 fs-22 text--w111-999 lh-30rpx mt-8 line1">{{collectRecommendList[2].store_info}}</view> </view> </view> <view class="flex-between-center scroll_cell" v-for="(item,index) in collectRecommendList.slice(3)" :key="index" @tap="goDetail(item)"> <view class="flex-y-center"> <text class="inline-block w-30 h-32 lh-32rpx text--w111-fff text-center fs-24 rank_4">{{index + 4}}</text> <text class="fs-26 text--w111-333 ml-20 w-360 line1"> <image v-if="item.delivery_type.indexOf('2') > -1" style="height:32.6rpx;width:116.08rpx;margin-right:10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodzt.png"></image> <image v-if="item.delivery_type.indexOf('1') > -1" style="height:32.6rpx;width:116.08rpx;margin-right: 10rpx;vertical-align:middle;" src="https://www.ytzhan.com/uploads/uniapp/2-glodzt.pngwww.ytzhan.com/uploads/uniapp/2-glodkd.png"></image><text style="vertical-align:middle;">{{item.store_name}}</text></text> </view> </view> </view> </view> </view> </scroll-view> </view> <scroll-view scroll-y="true" class="fuzzy_modal" :style="{height:fuzzyHeight + 'px',top: 60 + 'px'}" v-if="newPartyList.length" @touchmove.stop.prevent="moveStop"> <view class="cell" v-for="(item,index) in newPartyList" :key="index" @tap="setCommentSearch(item.id)"> <view class="keyword line1" v-html="item.keyword"></view> </view> </scroll-view> </view> </template> <script> let sysHeight = uni.getSystemInfoSync().statusBarHeight; import home from '@/components/home/index.vue' import { getSearchKeyword, getSearchRecommendApi, getHotWordApi } from '@/api/store.js'; import { searchList, clearSearch } from '@/api/api.js'; import recommend from '@/components/recommend'; import colors from "@/mixins/color"; import { goShopDetail } from '@/libs/order.js'; import { HTTP_REQUEST_URL } from '@/config/app.js'; import { Debounce } from '@/utils/validate.js' export default { components: { recommend, home }, mixins: [colors], data() { return { hostProduct: [], searchValue: '', focus: true, bastList: [], hotSearchList: [], isSpin:false, first: 0, limit: 8, page: 1, loading: false, loadend: false, loadTitle: '加载更多', hotPage: 1, isScroll: true, history: [], imgHost: HTTP_REQUEST_URL, salesRecommendList:[], scoreRecommendList:[], collectRecommendList:[], sysHeight:sysHeight, newPartyList: [], //模糊搜索关键词列表 isShowMore: false }; }, computed: { fuzzyHeight() { let screenHeight = uni.getSystemInfoSync().screenHeight; return screenHeight - this.sysHeight - 56; } }, onLoad(e) { this.searchValue = e.searchVal || ''; this.getSearchHotKeywords(); this.getSearchRecommend(); setTimeout(()=>{ this.newPartySearch(); },1000) }, onShow: function(e) { uni.removeStorageSync('form_type_cart'); this.searchList(); }, methods: { refresh(){ this.isSpin = true; this.getSearchHotKeywords(); }, // 获取搜索热词 getSearchHotKeywords(){ getHotWordApi().then(res=>{ this.hotSearchList = res.data; setTimeout(_=>{ this.isSpin = false; },1000) }) }, searchList() { searchList({ page: 1, limit: 10 }).then(res => { this.history = res.data; }); }, clear() { let that = this; clearSearch().then(res => { uni.showToast({ title: res.msg, success() { that.history = []; } }); }); }, inputConfirm: function(event) { if (event.detail.value) { uni.hideKeyboard(); this.setHotSearchValue(event.detail.value); } }, setValue: Debounce(function(e){ this.newPartySearch(); }), newPartySearch: function() { getSearchKeyword({keyword:this.searchValue}).then(res => { this.newPartyList = res.data.list; this.newPartyList.map((item) => { this.$set(item,'keyword',this.brightKeyword(item.store_name,res.data.keyword)); }); }); }, brightKeyword(val,keyword) { if (val.indexOf(keyword) > -1) { val = `<p class="line1">${val}</p>` return val.replace(keyword, `<span style="color: #C9771E;">${keyword}</span>`); } else { return val; } }, setCommentSearch(id) { uni.navigateTo({ url:'/pages/goods/goods_list/index?productId=' + id }) }, setHotSearchValue: function(event) { this.$set(this, 'searchValue', event); this.focus = false; this.searchBut(); }, searchBut: function() { let that = this; that.focus = false; if (that.searchValue.length > 0) { this.newPartyList = []; uni.navigateTo({ url:'/pages/goods/goods_list/index?searchValue=' + that.searchValue }) } else { return this.$util.Tips({ title: '请输入要搜索的商品', icon: 'none', duration: 1000, mask: true, }); } }, getSearchRecommend(){ getSearchRecommendApi(1).then(res=>{ this.salesRecommendList = res.data; }) getSearchRecommendApi(2).then(res=>{ this.scoreRecommendList= res.data; }) getSearchRecommendApi(3).then(res=>{ this.collectRecommendList= res.data; }) }, // 去详情页 goDetail(item) { goShopDetail(item, this.uid).catch(res => { uni.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` }); }); }, goRank(type){ uni.navigateTo({ url:`/pages/columnGoods/rank/index?type=${type}` }) }, clearSearchVal(){ this.searchValue = ''; this.newPartyList = []; } } } </script>排行榜有数据但是salesRecommendList、scoreRecommendList、collectRecommendList.length都为0且 即便res.data里有数据 打印出的length仍旧为0
06-24
数据驱动的两阶段分布鲁棒(1-范数和∞-范数约束)的电热综合能源系统研究(Matlab代码实现)内容概要:本文围绕“数据驱动的两阶段分布鲁棒(1-范数和∞-范数约束)的电热综合能源系统研究”展开,提出了一种结合数据驱动与分布鲁棒优化方法的建模框架,用于解决电热综合能源系统在不确定性环境下的优化调度问题。研究采用两阶段优化结构,第一阶段进行预决策,第二阶段根据实际场景进行调整,通过引入1-范数和∞-范数约束来构建不确定集,有效刻画风电、负荷等不确定性变量的波动特性,提升模型的鲁棒性和实用性。文中提供了完整的Matlab代码实现,便于读者复现和验证算法性能,并结合具体案例分析了不同约束条件下系统运行的经济性与可靠性。; 适合人群:具备一定电力系统、优化理论和Matlab编程基础的研究生、科研人员及工程技术人员,尤其适合从事综合能源系统、鲁棒优化、不确定性建模等相关领域研究的专业人士。; 使用场景及目标:①掌握数据驱动的分布鲁棒优化方法在综合能源系统中的应用;②理解1-范数和∞-范数在构建不确定集中的作用与差异;③学习两阶段鲁棒优化模型的建模思路与Matlab实现技巧,用于科研复现、论文写作或工程项目建模。; 阅读建议:建议读者结合提供的Matlab代码逐段理解算法实现细节,重点关注不确定集构建、两阶段模型结构设计及求解器调用方式,同时可尝试更换数据或调整约束参数以加深对模型鲁棒性的理解。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值