设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12557|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- {9 h/ P2 f0 M3 y6 Z
( p5 [0 s4 ]0 ^' L& o4 v, ^我的问题是,在每个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中的数值,不知道会不会有什么不妥。* y0 j" n' w/ o. N8 k3 W  Z# m
. g+ P! `6 K0 Q( L2 o! \: d
begin P_read arriving
2 x( Z! V! _, F% j, D: K' R5 a$ v    while 1=1 do begin
3 e2 L  [" K) R- [3 O3 f' ^        read A_tote from "data.txt" with delimiter "\n"; D: j4 E3 {! f& ]* v! G7 B8 Y
        read A_time from "data.txt" with delimiter "\n"
2 l' q! G$ @' B. ~: ?        read A_leave from "data.txt" with delimiter "\n"
, y0 P5 z2 t4 u# `9 Q! D% F        read A_picks from "data.txt" with delimiter "\n"+ c+ q; e  W/ d! `+ X' ~
        set load type to A_tote8 g4 y, P' ~9 l0 e. J
        if A_tote="tote 1" then set A_induct to 11 P( w" g" ^; D9 V
        else if A_tote="tote 2" then set A_induct to 2
# v! M+ Y0 m( R, _9 G1 J            else set A_induct to 3   
9 ]/ C0 W/ C8 f+ ~6 e- K! F        set A_i to 0  u& |% b( U+ e" Z
        clone 1 load to P_induction6 d5 F0 s* U, l' Q+ d3 j
        wait for A_time sec
! e$ X) w2 p5 P2 V) }    end
! @7 T1 n2 X5 O9 Oend! d" B: d' y. f; H) ]0 D9 U
) a" _# \6 a1 X7 e  y' t! e" h
begin P_induction arriving. z% s5 i9 ^: u5 G, l1 v
    if A_induct=1 then clone 1 load to P_pick13 p# {7 h  e2 l
    else if A_induct=2 then clone 1 load to P_pick25 K9 P& B/ U) S% ~! |' p% M6 v
        else clone 1 load to P_pick3  I" m& o# @0 @  u
end
, f: V: R+ n3 a7 d* j" c; n/ Q/ b) q8 u8 w+ I
begin P_pick1 arriving
  s6 D/ ]/ \3 d0 x1 N$ f    set A_i to 1
( a1 |1 k; W$ p7 q* e    move into Q_induct1
3 J. c% [; |# m7 ]8 v    move into pickaisle.induct14 B) Y7 q* ]( O5 L$ O1 p
    while A_i<=30 do begin: G* ^) X4 r, T4 c  T
        travel to pickaisle.con(A_i)
! K( X& r: q7 {& a- g1 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 U, z, [0 |" z2 J& D( d8 F        else wait for 10 sec& e. j9 ^( N% ^7 |
        if A_i=A_leave then send to die3 `1 r+ b8 m8 y2 p: y
        else inc A_i by 1
+ ~# Q% T  h- b    end( q; t' ?/ d2 ]  j' z8 h, ]! R
end
) O, h$ J& m  A+ K
1 {6 B: y4 P  H- Q- N8 obegin P_pick2 arriving
' @$ j9 W+ r* B9 A& Y1 @    set A_i to 11- m2 V; O# t. ~# Y
    move into Q_induct2
) t; D3 p3 A, @* l    move into pickaisle.induct2
; d" k/ p& C& T) `9 F    while A_i<=30 do begin; j0 r4 D* C6 U
        travel to pickaisle.con(A_i)
3 R0 D6 Y3 w% i& Q' o+ t) H/ {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, O- P* D/ C" P        else wait for 10 sec, ~# W6 n/ R+ h, `* F* M2 ~
        if A_i=A_leave then send to die7 k! `0 u2 E# U* g& [
        else inc A_i by 1
5 L! X' e- ?; }  W$ @# \  q$ L, o3 w    end1 x, O+ e1 q# K7 K3 h+ |) O
end- {% k3 n/ Q% y& e

) C" P' {! b* A8 |8 Vbegin P_pick3 arriving
% O- V$ h" |1 a! G    set A_i to 21
2 _+ X! [7 A- @2 t$ b6 u* z    move into Q_induct3
4 {5 V' k- o  y) N    move into pickaisle.induct3- D! I0 _0 |2 ^' Q( d* a+ p
    while A_i<=30 do begin
; J4 ~! p! ?2 D0 B' |! r        travel to pickaisle.con(A_i)' X% {1 a( Q! h" m& W: j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ f3 p6 x4 G; X9 O/ [/ X2 w        else wait for 10 sec8 |# C. i2 q0 I3 _  e2 X) P
        if A_i=A_leave then send to die, H( g) E8 r& s- a
        else inc A_i by 1
- q( w/ D: ?3 U+ y7 c  h- F" y% p    end
' s/ P& m: w7 t1 T- k8 ]: send

最佳答案

查看完整内容

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是个什么东东?
1 T! p: U: A9 j+ H. k4 C& Q+ Omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 M% y4 r; n+ o7 D7 s  V: r# L7 }+ j
$ H8 Z1 p9 x& y* S- j" n: \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# m/ _( }1 I6 Q" q  k) T3 p) z5 h' h% W; c9 v7 d( Y% ?+ o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
# ?" ]6 x; ?+ a. {, L: c1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% y5 S+ @. O0 h1 d2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 n+ I8 w/ U6 M, O4 g, C4 e# g
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 x  U4 f" j6 z+ N; O
begin P_induction arriving) Q1 T7 Y; i; X) {, o
    clone 1 load to P_pick(A_induct)
% Q; _5 M3 p/ n- zend最大的系
( z1 U, w/ m( \7 ?9 z% _4 n8 P2 P; [: N3 M$ D/ `7 @
begin P_pick arriving
; M$ G1 z6 j6 C' ^- X' I/ z2 b    set A_i to procindex * 10 + 1$ B( E* a+ {7 `8 v+ I* M) a# j: F
    move into Q_induct(procindex)
! ]/ b. J! O% v: d! B8 }' R2 j# {    move into pickaisle.induct(procindex)8 A  H% i4 Q6 Y
    /*check the type of pickaisle.induct(i), for your last problem.*/( \! a) e4 U' h; ?
$ i; A  ]+ Q' H- Y% t/ A, C
    while A_i<=30 do begin' _- W! y8 g, U6 s: n
        travel to pickaisle.con(A_i), K9 T9 `# h- E% x, F
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ v$ F: E. f0 \9 H( _" j* W6 M
        else wait for 10 sec) i8 [2 I6 f! i8 p( G; k
        if A_i=A_leave then send to die
5 w$ W5 j1 t% l; e$ G        else inc A_i by 1
: z7 U. d* R7 q+ c* Y( L    end0 c/ G' j- Y( |4 o  g4 ?, g
end$ E4 i' F# U; X* Y  @& t

; t, L" G3 L$ I" d7 t其中的procindex为整形,代表当前process的序号。7 s7 k8 _" s$ m! s! t0 d2 c
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-2-1 03:20 , Processed in 0.018138 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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