设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15118|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* W9 N2 T4 _! m9 N$ u, r4 a
! y& D+ [9 V1 L3 D! Q" g我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。" Z* r/ o+ @5 h$ t1 T6 @7 O- I" S5 T

. Z  N) F5 T" m. {8 jbegin P_read arriving6 D& M% H" w# `
    while 1=1 do begin1 [( E+ x" A; p9 O0 [; P
        read A_tote from "data.txt" with delimiter "\n"( Y9 I5 A7 m$ i$ f/ p! _
        read A_time from "data.txt" with delimiter "\n"
, \5 m9 o$ T; [5 `5 m- K        read A_leave from "data.txt" with delimiter "\n"! Y2 O7 e6 _( c5 N6 _* ~) A
        read A_picks from "data.txt" with delimiter "\n"9 M( n4 y1 R, J1 M4 b7 s
        set load type to A_tote5 |( Q& b+ w0 U9 h
        if A_tote="tote 1" then set A_induct to 1
& c5 K8 ?; [1 E7 ^, a6 u        else if A_tote="tote 2" then set A_induct to 23 s5 V# x  V2 I; y0 D
            else set A_induct to 3    7 ^8 K6 H8 ]' q/ Q" w2 U7 Z7 g
        set A_i to 0
7 H  d/ R/ w, G  V" V        clone 1 load to P_induction8 k$ I2 {! r5 X6 V! k
        wait for A_time sec
( V5 h2 c- c$ j# R/ E    end
% b9 v: [' ?0 {0 K' L% {5 yend# z& R$ g2 I+ b* `: r& S3 A

, L; a0 n. D5 z2 C; fbegin P_induction arriving9 R( k3 X" A$ d, z# I9 d8 H
    if A_induct=1 then clone 1 load to P_pick13 E  c* v6 T1 J7 |* [. {
    else if A_induct=2 then clone 1 load to P_pick2+ k* l5 @$ L0 h5 q/ m3 `2 ]/ h
        else clone 1 load to P_pick3; ^0 ~8 P5 G' u- w
end! b8 W3 W. X' G' R$ g
3 A) L. u- |# E, j& l, C$ Q
begin P_pick1 arriving
+ g3 f. L9 B& l4 L) H7 E    set A_i to 16 H( Z* ^1 |! Y2 E- ~: F  |3 Z/ w
    move into Q_induct1! f* k* n" g) F+ V" Z3 `
    move into pickaisle.induct1) }+ \* e( i2 G% F- K
    while A_i<=30 do begin- M$ }7 V" ]: T; w% H' \; D
        travel to pickaisle.con(A_i)7 g6 r4 O7 e4 b" T; p8 v0 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X: q/ @" D" M+ C, D
        else wait for 10 sec* A" X9 ^1 E; X
        if A_i=A_leave then send to die
5 y0 ^3 C! \; Q! g. z& w        else inc A_i by 1' I" {. Y. w) U: `0 u5 [! I3 i
    end* Q( x$ B7 O8 J
end
# R. s6 g, c, B+ ]+ ~/ o: Y$ [. A0 r/ N5 o1 f7 U- E; n; g) f) n
begin P_pick2 arriving
, V7 a9 s5 C, K3 r1 p7 k    set A_i to 118 F6 g% \7 A9 o& E% V% j9 H
    move into Q_induct26 r. o' b& {8 J' Q
    move into pickaisle.induct2
( v$ [3 O+ Z+ j; |3 r    while A_i<=30 do begin
( _7 [8 S7 z4 ?, N# h7 \& d        travel to pickaisle.con(A_i)) E% w- L+ ^9 G# W5 M: b- ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 f+ \: e7 Y7 O; Q
        else wait for 10 sec
5 }0 T# X) b! Q5 H        if A_i=A_leave then send to die
7 D4 E8 o6 ?2 r" {5 {8 M; k        else inc A_i by 1
" \2 d/ {5 N7 p    end
1 e0 v* z2 {+ R0 B- c2 l0 A; P; \; Cend
# i7 [- _4 w1 I$ L$ D. t* B  [; \' l
begin P_pick3 arriving
, w% k7 h5 ~; _3 ]4 }; k; k% }    set A_i to 21  F7 w" v# m- q3 B% \
    move into Q_induct33 M) {" z7 h- R7 |% T& t( |7 a
    move into pickaisle.induct3. H& {5 K4 ?% v( K' i# {% M8 x$ d
    while A_i<=30 do begin
" c7 X$ ~- Y! P. f        travel to pickaisle.con(A_i)2 g# d' S6 P2 u9 Z7 m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# r9 n; E" ~( Q  E' q
        else wait for 10 sec# n/ |5 q' _, w; e7 b, M7 U
        if A_i=A_leave then send to die: l( {- Y& U7 Y
        else inc A_i by 1$ [; Y: ]9 N. a' j/ W" F9 l7 S
    end) K" V! b1 H, M( d% a+ L/ J
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
* c2 l( j2 a6 `0 I* r1 Zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& M' V+ j* W" G: l+ M$ E! z7 M! Y  o8 P. ^
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; j; d* v5 X$ F6 Q* i6 T4 c5 V$ u/ d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
+ E" L# @# G+ B, r- O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;* k( r! ]% `% ?# k9 B1 h$ J$ r
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;7 C2 V; E* e  x4 l8 R
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
8 f' V) P7 [- `. [/ S# fbegin P_induction arriving2 t" i- n; D- R$ H1 X& U
    clone 1 load to P_pick(A_induct)
6 e, l  P# D+ t3 {end最大的系/ I7 ?0 x  r0 N: K7 ?+ `: x

+ F, v3 `1 a1 P$ a" Y( f" Sbegin P_pick arriving; |  b8 A4 a% E6 ^2 t8 p  \- \
    set A_i to procindex * 10 + 1: f8 v4 w3 h1 x! c
    move into Q_induct(procindex)
. Q( }5 T- J$ W% @8 h6 S, C8 j0 k    move into pickaisle.induct(procindex)
# f/ V' X8 L3 E0 J% u    /*check the type of pickaisle.induct(i), for your last problem.*/2 g0 c% w4 N; {% D( n

6 v9 H& i' _) k$ x+ M8 |* S    while A_i<=30 do begin2 \- Y! c; m" l1 \
        travel to pickaisle.con(A_i)
, R3 y. }; A+ V  j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& P/ o( D/ L/ x% _4 n
        else wait for 10 sec
4 y. Z5 V& T& U* r( v        if A_i=A_leave then send to die
2 }, g$ a1 ?' U( R        else inc A_i by 1
- E# N. }, ]) k6 S3 W# A    end* {" A& l& f- w* E2 S  A
end, w+ b& _5 K$ R" k6 t
+ K9 Q. l+ w9 M- X# D1 r4 u2 f1 Q
其中的procindex为整形,代表当前process的序号。. A4 [" `/ W' B' u3 r
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-12 08:10 , Processed in 0.013999 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表