设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15472|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 \  O8 \( z5 r2 \/ m  |" J! `, D1 i9 T. V  u( i$ O( `* 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中的数值,不知道会不会有什么不妥。* K$ k7 T% i. s& h2 b, `6 P; F; h  d

9 ?7 L! E3 h2 qbegin P_read arriving
" X1 Q0 r8 h  H# F' N8 k8 v% v    while 1=1 do begin
7 g6 j6 b6 D" }& ?        read A_tote from "data.txt" with delimiter "\n"
6 \6 B, f/ U! K4 i# V0 W& K        read A_time from "data.txt" with delimiter "\n"
# n7 F& U# C4 @( N3 L; h        read A_leave from "data.txt" with delimiter "\n"
& h: C8 ?4 o  z5 d1 _9 U$ Q1 W        read A_picks from "data.txt" with delimiter "\n"
$ D- }  k" B# E/ z9 A: _6 g" d. {4 Y        set load type to A_tote5 Q8 O" s4 D1 h0 j' ]: O
        if A_tote="tote 1" then set A_induct to 1, o2 W' H2 `# A+ Y% ]: u1 [1 y
        else if A_tote="tote 2" then set A_induct to 2
; B  [8 P: s6 I: x! E( D; Y( s            else set A_induct to 3    " p. C, A& f! `! M! n, u
        set A_i to 0
% g: X% e' c0 p- e6 }6 @, E; P% N        clone 1 load to P_induction
* r4 P' x* K! l, x        wait for A_time sec
' ]8 J& m9 |# J1 _6 Q& [- Y    end
7 H, j! |# w" A7 h3 n5 `end" z, _. `- j- J7 b

8 u: \" s  T6 T0 Z& U$ M! abegin P_induction arriving: [$ A3 y9 [  }: x( P
    if A_induct=1 then clone 1 load to P_pick19 v& d' j2 l8 f$ A; f2 K
    else if A_induct=2 then clone 1 load to P_pick2
: A) |- \( H& F) c  F1 A& B8 R        else clone 1 load to P_pick37 t, [. w* P) T; [$ ~. }. M* }
end
. B0 K" Q0 p/ ?$ r5 N3 f* a( n8 f
4 B/ H9 R- b( obegin P_pick1 arriving# `' k( h  z: |0 n
    set A_i to 1
  P" X! o# ?! @4 ~+ y    move into Q_induct11 L5 m# j3 l5 j1 t
    move into pickaisle.induct1
8 z& |8 G& z' D4 O" T; M/ C8 C    while A_i<=30 do begin
. I- s& |9 i/ [9 f! y: N        travel to pickaisle.con(A_i)% ]% K8 |$ K' d3 u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ S  @6 K4 |3 X8 x  t4 r        else wait for 10 sec
- v* y1 m% i5 ^( n        if A_i=A_leave then send to die: ?7 c5 ]5 }; V
        else inc A_i by 1
; x0 O/ a" A; R& A3 j    end6 A( y- o8 T* w1 B- E
end
# b) C$ o. q1 r) H7 W( t* m% P, X( X2 z# W- Y" M
begin P_pick2 arriving, n* A9 b4 z0 z: @$ @
    set A_i to 11
% e# A- j' \& v    move into Q_induct2$ v) v5 f+ c9 r4 F* T# t/ o
    move into pickaisle.induct2
7 {# t* W4 P$ H; |    while A_i<=30 do begin
8 U' ]/ C% m/ Y$ x4 ~9 r( d        travel to pickaisle.con(A_i). w- o; n( Q9 V- L3 k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 N' H+ n! n" R/ F0 ?        else wait for 10 sec
. j# Z- @! g! s  b/ v        if A_i=A_leave then send to die+ d4 X" U. J0 P* {
        else inc A_i by 12 e; n5 f* D) x6 }8 U/ I
    end
5 Y6 c: J3 K# Qend
/ Y* e, d) G5 l) Q2 v4 d  A
4 I& m+ U" c6 D# r9 {begin P_pick3 arriving
6 ?- X, @; u" [8 D4 I    set A_i to 21
$ a7 j  J/ d' V% G! v    move into Q_induct32 i- l7 Z/ S$ v  ^2 `
    move into pickaisle.induct3
. ?, }/ e" y/ L    while A_i<=30 do begin. \1 I, I7 f! r
        travel to pickaisle.con(A_i)
+ m) u) N$ a8 P! h1 f9 z/ g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* a6 Z& U, z9 [8 U
        else wait for 10 sec1 V% v" x1 J: Q* {: Y; m- x
        if A_i=A_leave then send to die
+ ~0 o# ?  g) z, O4 P7 E        else inc A_i by 1+ D1 d/ l; l* e- u3 m
    end
1 [: \" \8 w/ {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是个什么东东?% l6 {/ I: \0 w5 g; A
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( e2 m% U+ ^  E! Z* f# R5 F/ p4 y  M6 c
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. \: y0 U% L9 E& d3 I0 G5 H7 r& I
' p3 L4 V' w$ L: W
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ y8 T! t, M4 J7 p' I1 v
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;! A4 C. G8 F% j& W  f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 H- `- \. {) F5 {# q4 r, m
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:& S0 O: {' x6 ^. M3 ~# z* ^
begin P_induction arriving
" b% I6 j3 ~! S/ T. ]- m7 \    clone 1 load to P_pick(A_induct), ^4 j& L0 Y2 D; S
end最大的系( e8 m3 x7 H4 j5 g3 p# H1 D5 E

7 I* O! g8 K; ?( b' c, gbegin P_pick arriving$ |) T; C, S- H7 ~" t6 @
    set A_i to procindex * 10 + 1
3 f- Z3 a4 u2 r# [5 N* B6 s    move into Q_induct(procindex)
* O6 M" F1 t) ?3 z    move into pickaisle.induct(procindex)
. r! h& l* f3 b$ M    /*check the type of pickaisle.induct(i), for your last problem.*/. J, b9 O8 U0 r1 y7 b

( d& `! n. G' [; C+ S1 Y0 Z- X    while A_i<=30 do begin0 `% {2 F0 w! }
        travel to pickaisle.con(A_i)
+ W  _5 b4 i6 p$ W1 M" C        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ p9 l" A. [1 `" C% M4 i
        else wait for 10 sec+ I$ W; p+ z$ Z) f# J+ C$ M
        if A_i=A_leave then send to die  q, P% {4 N& f, P; b' ~/ t* W
        else inc A_i by 1
. N, ^" [. \9 [    end5 B( z$ J. n4 u5 [0 H
end9 F- s8 p7 v$ p. {! h$ N, a

* ^( ]$ y% H/ ?- z0 _$ s' P9 h其中的procindex为整形,代表当前process的序号。5 ^% W8 Z; ~! ^" m. [% G
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-9-13 07:05 , Processed in 0.016918 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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