设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13826|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ^6 j: h5 E, \

/ e; P! C9 n- Z! Y. @$ a我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 a; S# T& g, i0 g, |
3 E" G2 A/ X, m+ x
begin P_read arriving, q: Z" d; m% ?
    while 1=1 do begin
+ @( n; V; W- v1 [        read A_tote from "data.txt" with delimiter "\n"
2 y" x/ C7 p# F* q: L        read A_time from "data.txt" with delimiter "\n"
5 L5 G. Q8 \/ S7 g( K) x        read A_leave from "data.txt" with delimiter "\n"
: z0 k; m# g/ G$ I        read A_picks from "data.txt" with delimiter "\n"9 X# x" }7 z0 o
        set load type to A_tote
# e8 w, p$ C4 ~; p        if A_tote="tote 1" then set A_induct to 1
; z# \: w, m' o( {& h        else if A_tote="tote 2" then set A_induct to 23 L0 F. T7 ^3 A- F3 z0 K1 E
            else set A_induct to 3   
( Z9 e% r' o! s& m2 O) h. w        set A_i to 0; D  N1 H  l- s9 r
        clone 1 load to P_induction
' ]4 z% J5 e; t1 U" i  h        wait for A_time sec: _2 A2 j) r1 Q+ c4 D
    end
0 {; L- |5 V$ j3 c* g: a( iend  w. ~- [9 |) \4 X& s2 \3 H6 H$ b
8 a3 `! H2 X" k. x; u2 d4 I
begin P_induction arriving3 ]' i4 c6 I2 J$ n: Q  u) A
    if A_induct=1 then clone 1 load to P_pick1
7 R. H% c. o. u& g, x+ U5 n  Z    else if A_induct=2 then clone 1 load to P_pick2: ~  Y& i/ L2 g! J
        else clone 1 load to P_pick3
$ d; b0 t0 M8 b1 ~! g1 C4 rend& s/ r+ o9 D! Q, h8 ^3 V' Q

# W( w7 r5 n" |7 I2 S. gbegin P_pick1 arriving
* F0 m" v2 c5 \- [1 Y. u2 r    set A_i to 1, T0 B! m/ q, i& [
    move into Q_induct1+ @$ _' ^( Y+ f; l1 b7 {
    move into pickaisle.induct1
4 \* R! x4 O% c" M, K    while A_i<=30 do begin0 ^2 U0 O1 C4 t8 F* |
        travel to pickaisle.con(A_i)* ^3 @( b. a4 E9 C- z3 [: R$ w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 M. r1 p$ M# D( q5 v
        else wait for 10 sec
% Y6 v5 @5 ~" B, M6 u- [        if A_i=A_leave then send to die" l) `3 w1 R" w/ I8 p5 E
        else inc A_i by 1
/ u# P* H  ]' U5 q; w7 E    end
) I1 \  U1 |; p% J2 j, nend2 c. [" u$ |' N  A2 |, L2 u

; V( ~, o) D: e' u& [begin P_pick2 arriving; \% K( e4 b; p! {& G3 A
    set A_i to 112 E6 m& Q* C$ `8 V4 c
    move into Q_induct21 S+ X. [2 `& s
    move into pickaisle.induct22 b+ |( T# k/ S, {4 l$ O
    while A_i<=30 do begin2 E7 M' Z* `6 Q/ z2 L1 W- K" }
        travel to pickaisle.con(A_i)
0 K) t4 s3 r- i( b0 S4 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; }  V6 m- y+ j1 M" T9 w0 K+ B/ p6 |
        else wait for 10 sec: Z( M' R2 f( c' b
        if A_i=A_leave then send to die
4 F9 u4 v- C9 t( R' G6 h        else inc A_i by 1: n& i- ~- _$ z' ^6 T1 }
    end
  B2 R4 B& e* y6 ?3 `. xend3 V& c, A( L4 E
! e- h% H0 Y0 G9 f! k
begin P_pick3 arriving
7 t: q) h. T  X5 @" ~" z+ ~    set A_i to 21
4 B( S( |3 s/ ?. t& h    move into Q_induct3
. U: y( j# r3 ~0 d* S    move into pickaisle.induct3
9 C, H$ |" W0 j+ S7 i7 r+ Q- Q    while A_i<=30 do begin
  j5 Z% {3 u- k4 |( m# L        travel to pickaisle.con(A_i)
- z  }7 s& |0 ]- }* D3 e0 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  K; t- Z0 ~' e+ O; a        else wait for 10 sec5 u5 g6 c2 J) j5 S* p
        if A_i=A_leave then send to die( i! r  t8 E- ~5 R5 y5 z- `$ A% g
        else inc A_i by 1  w  j, P" F; C3 \! {/ g
    end
$ F, }3 x- m5 V7 u4 vend

最佳答案

查看完整内容

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是个什么东东?7 \3 u! ~' ?8 S. J  M: ~7 u* M( L
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
8 ?. b' P; y7 R1 y; K8 |$ D0 l  D  A7 a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。7 A( d3 A7 \  c  }- |3 }

3 ]$ d( z* f+ u: p. g另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 v: x5 U7 j( L+ Q) j3 ]' U* c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: U* _& U0 R4 E% H* }1 N) u. Z" f2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 D1 x7 ]* D; C6 i% {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
6 F3 Z- E2 G( O4 J6 r; V" r" A; L6 tbegin P_induction arriving. q, [: C# K* k* e* @
    clone 1 load to P_pick(A_induct)! E3 C0 p1 x  i7 j$ {2 L9 }
end最大的系
6 ^( h9 z7 @5 n  F& X
; d9 f- U9 V5 n4 @  }3 m3 W( }$ J! D2 \begin P_pick arriving* w( _. X0 W9 C6 o: y$ Y8 d  y. {$ R
    set A_i to procindex * 10 + 1
; s5 X9 x# b2 {- O; ]4 C    move into Q_induct(procindex)
2 o& V; q0 \, T) h    move into pickaisle.induct(procindex)3 l, p  t( B: Q- W+ d( ?
    /*check the type of pickaisle.induct(i), for your last problem.*/+ B( x( s- X6 Z: e" j4 D: n
. f; J2 S8 c$ H6 U" M
    while A_i<=30 do begin  ]! N# ]) _& o
        travel to pickaisle.con(A_i)
" Q. A6 O1 M  U- `        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ r+ G2 A2 ^! U. D! |4 d0 v        else wait for 10 sec. w4 X3 R$ Z8 F! Y9 `+ r; }! w9 ]
        if A_i=A_leave then send to die" X& w. `8 j6 D7 F8 T
        else inc A_i by 1
9 C. N+ \5 D$ m. o    end9 Y# ^+ [7 {+ J
end
% `8 e0 A, f# Q" G1 p7 L# r, `5 B' U  E1 e3 h& k# A3 M( }9 b% i
其中的procindex为整形,代表当前process的序号。# [& p! }* E; m8 q7 z( `' I. a4 w
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-5-8 15:39 , Processed in 0.014720 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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