设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14126|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ ?/ i% `- b( m% H% c6 b" }6 h( _+ a
/ h! `! B3 O6 P$ d, S4 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ Z4 M) j1 V" t" D) K
( Y9 w- \% V; n
begin P_read arriving4 l' n  |5 E4 m! C( T
    while 1=1 do begin2 c; G: E& X. _# d+ _- l& }  j2 V
        read A_tote from "data.txt" with delimiter "\n"
+ l  `5 l: v$ N( [! z# B        read A_time from "data.txt" with delimiter "\n"
/ ]0 f2 l. H2 G        read A_leave from "data.txt" with delimiter "\n"
4 h' a9 p+ L1 j+ ^6 W, V        read A_picks from "data.txt" with delimiter "\n"
1 `. w; \$ o5 p, |1 H) c* A        set load type to A_tote; [/ }, \3 @) \6 c0 K
        if A_tote="tote 1" then set A_induct to 1! }" M' c; ?% }9 k- ^
        else if A_tote="tote 2" then set A_induct to 2( j) w8 O% J! g6 ?3 S, u
            else set A_induct to 3    7 d8 o  S* V. ^8 \7 }$ V
        set A_i to 0
3 h- p( A0 q" L        clone 1 load to P_induction! D( q$ k3 Z& d
        wait for A_time sec6 H9 e$ H0 K9 E
    end( i) u9 V. h1 A
end
1 X3 }7 i0 ~9 e6 }
0 [/ V4 A& j# z* G- pbegin P_induction arriving5 f( d. V  u9 Z7 P' p
    if A_induct=1 then clone 1 load to P_pick1+ F9 ]3 ^% V# T* I& o% d
    else if A_induct=2 then clone 1 load to P_pick2. l. ^1 w% n+ ?
        else clone 1 load to P_pick3
2 P8 K/ v3 c! r) b* D; h- e% v4 wend
- @3 H5 `4 y( s  S) j; ~/ U* @0 J. A' F$ X2 r8 U
begin P_pick1 arriving- C' _. _0 {7 ~5 q1 `
    set A_i to 1) [0 r+ ^& G8 x9 Q
    move into Q_induct1  o. n" ^" `0 I  \) p( b
    move into pickaisle.induct1: G6 ^9 @. T  o( E, H" A3 b9 e9 W
    while A_i<=30 do begin4 O8 q. i2 ^" ~0 O1 S
        travel to pickaisle.con(A_i)/ }& j! p2 |/ `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) {. R) ~1 Z7 c+ l6 D. ~2 a; S' x        else wait for 10 sec) P1 T& R, H( m
        if A_i=A_leave then send to die3 H+ i1 _: l! P: q/ M5 P
        else inc A_i by 1' \, F+ |. e/ b$ `. Q) O
    end
; l2 E1 n, D, Q1 b) k  l; Dend
5 W4 i3 R0 t- c7 \6 w
' Q9 c9 W$ W. z8 d4 ?6 Lbegin P_pick2 arriving
  |, W$ y) F0 e9 M4 ?/ h: q( n    set A_i to 11' A+ ^+ V0 f6 I" r
    move into Q_induct2
8 ?& b# {$ S. h/ i5 D    move into pickaisle.induct28 j* |/ C. f! J+ D1 A3 v, S
    while A_i<=30 do begin5 u: Q/ ~' R# n) N
        travel to pickaisle.con(A_i)
' }. {1 [3 W5 s" j  a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j: |# t' X. @: g4 W0 R; t9 W# v        else wait for 10 sec
" G$ `* K* Q' m* O        if A_i=A_leave then send to die
8 @9 B$ N2 y$ R( h* W( @2 j4 w        else inc A_i by 1
: c- \' l. R/ s; W' `% u    end
) x$ y) \+ X# Send
" e7 z) _* E4 u# Z
) x0 n5 l( w1 \. }' m' R3 b/ Z, Fbegin P_pick3 arriving
! t$ Y8 U, @2 c6 f: c7 u6 d0 b* A$ }/ T    set A_i to 21
2 x! m$ E1 E* @3 {, ~1 B    move into Q_induct3
( Z* Y+ Q' `% @) x: v    move into pickaisle.induct3
% l% U# w' f* d- ~    while A_i<=30 do begin
3 c" N, G, T& \        travel to pickaisle.con(A_i)
8 F' }) {# S5 R, l; `8 u7 K" Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 V, `' y# p$ k) H
        else wait for 10 sec
# `1 J4 B8 r/ z* A& |8 z0 J        if A_i=A_leave then send to die1 d4 J: ~; ]' P
        else inc A_i by 1
( X0 T8 s0 e; x8 e- j6 ^) d1 L    end
0 d1 a- \8 f& z9 e3 Pend

最佳答案

查看完整内容

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是个什么东东?& X  ?0 y, P" G# V% D8 @0 r* J
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
% q0 Z8 W4 n  @1 `" s
/ M0 t- B5 ?+ HAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) a' X# D, A: c

  ]8 F0 M6 Y" _' W( x% u另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 A! i( g5 N8 J: R) d
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;3 x/ [. c: S2 F( z
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, J" `, _2 w; @. t3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  `' K, U0 g; h( E( K5 l; M
begin P_induction arriving( C& f4 B0 F1 Y! l2 A2 L
    clone 1 load to P_pick(A_induct)
: a" o' P& a8 F! [7 g  U. cend最大的系# p+ `% b3 H. ^8 t" I  u% X: Z, [- v
5 z& R! ~% w8 g, y) w( o
begin P_pick arriving
$ R& m. x* U$ L4 y    set A_i to procindex * 10 + 1
5 `3 V. L0 X1 G! s    move into Q_induct(procindex)  W- L. {$ g" y8 W& w2 H7 |. t
    move into pickaisle.induct(procindex)
( ^: `& R- ]1 t8 v    /*check the type of pickaisle.induct(i), for your last problem.*/3 w7 F1 f% N4 |; v' c

: }! r  O) p' o% c7 C1 _8 F- ~    while A_i<=30 do begin$ i: [$ z2 I7 g+ ]  }' @1 g
        travel to pickaisle.con(A_i)
/ S# w* Q. W! H7 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! }4 E' y5 j& x+ |) q" z7 P. U
        else wait for 10 sec: {9 e6 o# k7 f# }# [  J7 A* r* t
        if A_i=A_leave then send to die4 _4 e6 M" j  w5 J" n
        else inc A_i by 1
9 r8 W9 \1 n6 C( x/ Z+ K    end9 m) g6 q' f7 x+ i; d
end
2 j# f5 P  ]" b, l2 B
- n% D5 O" N3 j0 X: v! m  \其中的procindex为整形,代表当前process的序号。3 ^$ u  I  ]$ B1 a3 Z& @
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-6-11 19:30 , Processed in 0.017580 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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